Was trying to prune custom trained yolov5 model with torch.nn.utils.prune as shown in tutorial (Pruning Tutorial — PyTorch Tutorials 1.12.0+cu102 documentation), using the API.
Prunning goes with no errors yet the model raise error as None, meaning it does not exists after prunning. None prunned model runs correctly (.pt model)
- Is it possible to prune yolov5 custom model?
- if 1 is positive, can any one indicate possible cause?
Error:" File “main.py”, line 65, in main
inference = model(img)
TypeError: ‘NoneType’ object is not callable"
It was done in torch container environment (PyTorch | NVIDIA NGC the 21.09-py3)