Closed manikandtan-ck closed 4 years ago
by the way, i don't think i can find the same thing here: https://github.com/microsoft/MMdnn/blob/master/mmdnn/conversion/pytorch/pytorch_graph.py
Yeah. Sorry that was from the pip install version. the source version from GitHub, while having the same version number, seems to have different code. The issue is not present there.
Platform (like ubuntu 16.04/win10): Ubuntu 18.04
Python version: 3.6.9
Source framework with version (like Tensorflow 1.4.1 with GPU): pytorch 1.5.1+cpu
Destination framework with version (like CNTK 2.3 with GPU): IR
Pre-trained model path (webpath or webdisk path): https://github.com/duanzhiihao/RAPiD/releases/download/v0.1/pL1_MWHB1024_Mar11_4000.ckpt
Running scripts: mmtoir -f pytorch -d resnet50 --inputShape 3,1024,1024 -n models/RAPiD_full.pt
created the .pt file by running the following in api.py in the RAPiD repo:
Error:
Traceback (most recent call last): File "/home/dev/.local/bin/mmtoir", line 8, in
sys.exit(_main())
File "/home/dev/.local/lib/python3.6/site-packages/mmdnn/conversion/_script/convertToIR.py", line 197, in _main
ret = _convert(args)
File "/home/dev/.local/lib/python3.6/site-packages/mmdnn/conversion/_script/convertToIR.py", line 97, in _convert
parser = PytorchParser151(model, inputshape[0])
File "/home/dev/.local/lib/python3.6/site-packages/mmdnn/conversion/pytorch/pytorch_parser.py", line 523, in init
self.build_graph(input_shape)
File "/home/dev/.local/lib/python3.6/site-packages/mmdnn/conversion/pytorch/pytorch_parser.py", line 92, in build_graph
self.pytorch_graph.build(self.input_shape)
File "/home/dev/.local/lib/python3.6/site-packages/mmdnn/conversion/pytorch/pytorch_graph.py", line 142, in build
self.shape_dict[node_name] = output_shape
UnboundLocalError: local variable 'output_shape' referenced before assignment
the Error seems to be coming from mmdnn/conversion/pytorch/pytorch_graph.py", line 138:
is the out_put_shape a typo?