Problems in Pruning #6932
-
Hello, I am trying to get pruning to work within my lightning model. I have tried multiple methods, but have not been able to get the ModelPruning module to work. When I try this:
I get this output:
Which makes it seem like ModelPruning is not finding my model's weights, though I do not understand why. If I put into ModelPruning weights that do not exist in the model. It catches that problem during ModelPruning's init. Which is not happening here. So that does not seem to be the problem. I have also tried bypassing the parameters_to_prune parameter altogether.
This works right until it does not. One epoch runs and then it snags on a callback within the validation step.
I am a bit overwhelmed by that error. Does anyone know what I am doing wrong? Or have I found a bug? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
For the first error, what does You get the error because the following code can't find the parameters you passed in your model: The second error is definitely a bug. It happens because you are also using a profiler. Should be fixed in master, the fix will be released in 1.3. Feel free to try it on master in the meantime. |
Beta Was this translation helpful? Give feedback.
For the first error, what does
pl_module.modules()
return?You get the error because the following code can't find the parameters you passed in your model:
https://github.com/PyTorchLightning/pytorch-lightning/blob/4c07ab5e99dd20c1f309d9e73cdaacc1ebad9499/pytorch_lightning/callbacks/pruning.py#L422-L444
The second error is definitely a bug. It happens because you are also using a profiler. Should be fixed in master, the fix will be released in 1.3. Feel free to try it on master in the meantime.