Pruning model speed up error
See original GitHub issueAfter using the pruning API on the model, when I try to perform the speed up, it throws this error :
Error: TypeError: forward() missing 1 required positional argument: input
Traceback:
m_speedup.speedup_model()
File “/pruning/lib/python3.6/site-packages/nni/compression/pytorch/speedup/compressor.py”, line 503, in speedup model self.infer_modules_masks() File “/pruning/Python-test/lib/python3.6/site-packages/nni/compression/pytorch/speedup/compressor.py”, line 349. in infer_modules masks self.update_direct_sparsity(curnode) File “/pruning/Python-test/lib/python3.6/site-packages/nni/compression/pytorch/speedup/compressor.py”, line 219, in update direct sparsity state_dict-copy.deepcopy(module.state_dict()). batch_dim=self.batch_dim) File “/pruning/Python-test/lib/python3.6/site-packages/nni/compression/pytorch/speedup/infer_mask.py”, line 80, in_init__ self.output = self.module("dummy_input) File “/pruning/Python-test/lib/python3.6/site-packages/torch/nn/modules/module.py”, line 889, in _call_impl result = self.forward("input, **kwargs)
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (7 by maintainers)

Top Related StackOverflow Question
Yes, I’ll provide the logs soon, please keep this issue open.
yes, the dummy input is used for tracing the model graph, please refer usage of
example_inputsintorch.jit.tracehttps://pytorch.org/docs/stable/generated/torch.jit.trace.html