This repository was archived by the owner on Sep 18, 2024. It is now read-only.
This repository was archived by the owner on Sep 18, 2024. It is now read-only.
AutoCompress with level pruner leads to runtime error #3948
Open
Description
Describe the issue:
Running autocompress with level pruner on InceptionV3 model leads to this error:
RuntimeError: Has not supported infering input shape from output shape for module/function: aten::cat, Mixed_5b.aten::cat.222
Config used: [{'sparsity': 0.6656322824445615, 'op_types': ['Linear']}, {'sparsity': 0.6198551248545695, 'op_types': ['Conv2d']}]
Error log:
Traceback (most recent call last):
...
File "/home/ubuntu/projects/mltesting/fuzzer/compression/nni_lib.py", line 128, in init_pruner
pruner.compress()
File "/home/ubuntu/anaconda3/envs/pytorch_latest_p37/lib/python3.7/site-packages/nni/algorithms/compression/pytorch/pruning/auto_compress_pruner.py", line 212, in compress
m_speedup.speedup_model()
File "/home/ubuntu/anaconda3/envs/pytorch_latest_p37/lib/python3.7/site-packages/nni/compression/pytorch/speedup/compressor.py", line 183, in speedup_model
self.infer_modules_masks()
File "/home/ubuntu/anaconda3/envs/pytorch_latest_p37/lib/python3.7/site-packages/nni/compression/pytorch/speedup/compressor.py", line 140, in infer_modules_masks
self.infer_module_mask(module_name, None, mask=mask)
File "/home/ubuntu/anaconda3/envs/pytorch_latest_p37/lib/python3.7/site-packages/nni/compression/pytorch/speedup/compressor.py", line 120, in infer_module_mask
self.infer_module_mask(_module_name, module_name, out_shape=input_cmask)
File "/home/ubuntu/anaconda3/envs/pytorch_latest_p37/lib/python3.7/site-packages/nni/compression/pytorch/speedup/compressor.py", line 111, in infer_module_mask
.format(m_type, module_name))
RuntimeError: Has not supported infering input shape from output shape for module/function: `aten::cat`, Mixed_5b.aten::cat.222
Environment:
- NNI version: 2.3
- Training service (local|remote|pai|aml|etc): local
- Client OS: ubuntu 18.04
- Python version: 3.7
- PyTorch/TensorFlow version: Pytorch 1.8.1
- Is conda/virtualenv/venv used?: conda
- Is running in Docker?: no
Let me know if you need more details/the full error log. Thanks!