Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pytorch to IR Error (.pth ImportError) #383

Open
wwqLearning opened this issue Aug 29, 2018 · 8 comments
Open

Pytorch to IR Error (.pth ImportError) #383

wwqLearning opened this issue Aug 29, 2018 · 8 comments

Comments

@wwqLearning
Copy link

Platform (ubuntu 16.04):

Python version: python2.7

Source framework with version (Pytorch 0.4.0 with CPU):

Destination framework with version (caffe with CPU):

Pre-trained model path (disk path):

Running scripts: mmtoir -f pytorch -d enet --inputShape 6,384,384 -n model_net_G.pth

Error: ImportError: No module named Mode.enet_mode

@namizzz
Copy link
Contributor

namizzz commented Aug 29, 2018

Hi @wwqLearning , there is a class names Mode defined by you. Please refer to this

@wwqLearning
Copy link
Author

@namizzz Thanks. I have solved the ImportError, but have another error in maxpool2d with indice.

@namizzz
Copy link
Contributor

namizzz commented Aug 29, 2018

Hi @wwqLearning , could you please provide the whole error stack?

@wwqLearning
Copy link
Author

@namizzz The error is "graph = torch._C._jit_pass_onnx(graph, aten)
RuntimeError: symbolic for max_pool2d returned None for the output1(indicating conversion for the particular output is not supported), but the network uses this output later. "

@namizzz
Copy link
Contributor

namizzz commented Aug 30, 2018

Hi @wwqLearning , we want something like #388 (comment) , and could you provide your model files?

@wwqLearning
Copy link
Author

@namizzz Is this the whole error stack?
" /root/anaconda2/lib/python2.7/site-packages/torch/nn/functional.py:1749: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
"See the documentation of nn.Upsample for details.".format(mode))
Traceback (most recent call last):
File "/root/Map0823/Net/pytorch2caffe_converter.py", line 34, in
pytorchparser = PytorchParser(netG, shape)
File "/root/tools/PytorchToCaffe-master/MMdnn/mmdnn/conversion/pytorch/pytorch_parser.py", line 83, in init
self.pytorch_graph.build(self.input_shape)
File "/root/tools/PytorchToCaffe-master/MMdnn/mmdnn/conversion/pytorch/pytorch_graph.py", line 124, in build
trace.set_graph(PytorchGraph._optimize_graph(trace.graph(), False))
File "/root/tools/PytorchToCaffe-master/MMdnn/mmdnn/conversion/pytorch/pytorch_graph.py", line 74, in _optimize_graph
graph = torch._C._jit_pass_onnx(graph, aten)
RuntimeError: symbolic for max_pool2d returned None for the output 1 (indicating conversion for that particular output is not supported), but the network uses this output later."
And I can not give the model files for some reasons.

@wwqLearning
Copy link
Author

@namizzz The model is something like the model in https://github.com/davidtvs/PyTorch-ENet

@namizzz
Copy link
Contributor

namizzz commented Sep 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants