Torch-Pruning
Torch-Pruning copied to clipboard
torch.jit.trace of pruned model fails when L2Norm is involved
Hello,
I am attempting to use Torch_Pruning to prune SSD model.
Note that I use this fork: https://github.com/dkurt/ssd.pytorch/tree/opencv_support
Once I pruned away some of conv filters in the vgg layers, I get the following error with torch.jit.trace on the pruned model:
$ python prune_TP_git_issue.py --model ssd300_mAP_77.43_v2.pth
. . .
File "prune_TP_git_issue.py", line 62, in
Attaching the python file. prune_TP_git_issue.ssd.pytorch.py.zip
Hi @abuvaneswari
L2Norm is a customized layer and thus not supported in this repo. I'm working on this to support customized ops and rules.
Please refer to "examples/customized_layer.py". A detailed tutorial will be uploaded soon.
@VainF , thanks a lot! Your example and the latest commits were extremely helpful. Now the jit trace succeeds!