Platform (like ubuntu 16.04/win10): Ubuntu 16.04
Python version: 2.7.14
Source framework with version (like Tensorflow 1.4.1 with GPU): PyTorch 0.4.0
Destination framework with version (like CNTK 2.3 with GPU): IR
Pre-trained model path (webpath or webdisk path): customized PyTorch model
Running scripts: mmtoir -f pytorch -d resnet101 --inputShape 3,224,224 -n imagenet_resnet101.pth
I made some modification to the PyTorch ResNet and tried to convert it to IR, but I got the following errors:
Traceback (most recent call last):
File "/home/bcheng/anaconda2/bin/mmtoir", line 11, in <module>
load_entry_point('mmdnn==0.2.3', 'console_scripts', 'mmtoir')()
File "/home/bcheng/anaconda2/lib/python2.7/site-packages/mmdnn/conversion/_script/convertToIR.py", line 192, in _main
ret = _convert(args)
File "/home/bcheng/anaconda2/lib/python2.7/site-packages/mmdnn/conversion/_script/convertToIR.py", line 92, in _convert
parser = PytorchParser(model, inputshape[0])
File "/home/bcheng/anaconda2/lib/python2.7/site-packages/mmdnn/conversion/pytorch/pytorch_parser.py", line 76, in __init__
model = torch.load(model_file_name, map_location='cpu')
File "/home/bcheng/anaconda2/lib/python2.7/site-packages/torch/serialization.py", line 303, in load
return _load(f, map_location, pickle_module)
File "/home/bcheng/anaconda2/lib/python2.7/site-packages/torch/serialization.py", line 469, in _load
result = unpickler.load()
ImportError: No module named models.resnetv1
</module>
I tried
torch.load('imagenet_resnet101.pth')
and it worked fine.
Any suggestions how to convert this model? Thanks!
该提问来源于开源项目:microsoft/MMdnn