You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Platform (like ubuntu 16.04/win10):
centos6
Python version:
2.7.5
Source framework with version (like Tensorflow 1.4.1 with GPU):
pytorch0.4.0 CPU
Destination framework with version (like CNTK 2.3 with GPU):
IR(eventually caffe) CPU
Pre-trained model path (webpath or webdisk path):
Running scripts:
Hello, everyone.
I want to transform network from pytorch to caffe. First i should transform it from pytorch to IR. In the network, there are basic layers like conv2d,pooling2d,fc and a custom layer written by myself. I generated the module file and transformed it from pytorch to IR. But an error occured, it seemed like that it was problem about torch.jit.
Detailed information: Traceback (most recent call last): File "demo_pt2caffe.py", line 56, in <module> test = Convert('/mnt/chenhui/code/mmdnn_custom/tests/model/net.pth'); File "demo_pt2caffe.py", line 11, in __init__ self.PytorchParse() File "demo_pt2caffe.py", line 30, in PytorchParse parser = PytorchParser(self.src_model_path[0], [1, 28, 28]) File "/usr/local/lib/python2.7/site-packages/mmdnn/conversion/pytorch/pytorch_parser.py", line 85, in __init__ self.pytorch_graph.build(self.input_shape) File "/usr/local/lib/python2.7/site-packages/mmdnn/conversion/pytorch/pytorch_graph.py", line 125, in build trace, output = torch.jit.get_trace_graph(self.model, (dummy_input, )) File "/usr/local/lib/python2.7/site-packages/torch/jit/__init__.py", line 255, in get_trace_graph return LegacyTracedModule(f, nderivs=nderivs)(*args, **kwargs) File "/usr/local/lib/python2.7/site-packages/torch/nn/modules/module.py", line 491, in __call__ result = self.forward(*input, **kwargs) File "/usr/local/lib/python2.7/site-packages/torch/jit/__init__.py", line 288, in forward out = self.inner(*trace_inputs) File "/usr/local/lib/python2.7/site-packages/torch/nn/modules/module.py", line 489, in __call__ result = self._slow_forward(*input, **kwargs) File "/usr/local/lib/python2.7/site-packages/torch/nn/modules/module.py", line 479, in _slow_forward result = self.forward(*input, **kwargs) File "/mnt/chenhui/code/mmdnn_custom/tests/mnist_test.py", line 67, in forward x = self.abc(x, self.abc) File "/usr/local/lib/python2.7/site-packages/torch/nn/modules/module.py", line 489, in __call__ result = self._slow_forward(*input, **kwargs) File "/usr/local/lib/python2.7/site-packages/torch/nn/modules/module.py", line 466, in _slow_forward input_vars = tuple(torch.autograd.function._iter_tensors(input)) File "/usr/local/lib/python2.7/site-packages/torch/autograd/function.py", line 275, in _iter for var in _iter(o): File "/usr/local/lib/python2.7/site-packages/torch/autograd/function.py", line 284, in _iter if condition_msg else "")) ValueError: Auto nesting doesn't know how to process an input object of type mnist_test.ABC. Accepted types: Tensors, or lists/tuples of them
So, can you tell me how to solve this problem? And how to transfrom network with customer layers from pytorch to IR?
Thank you very much.
The text was updated successfully, but these errors were encountered:
Platform (like ubuntu 16.04/win10):
centos6
Python version:
2.7.5
Source framework with version (like Tensorflow 1.4.1 with GPU):
pytorch0.4.0 CPU
Destination framework with version (like CNTK 2.3 with GPU):
IR(eventually caffe) CPU
Pre-trained model path (webpath or webdisk path):
Running scripts:
Hello, everyone.
I want to transform network from pytorch to caffe. First i should transform it from pytorch to IR. In the network, there are basic layers like conv2d,pooling2d,fc and a custom layer written by myself. I generated the module file and transformed it from pytorch to IR. But an error occured, it seemed like that it was problem about torch.jit.
Detailed information:
Traceback (most recent call last): File "demo_pt2caffe.py", line 56, in <module> test = Convert('/mnt/chenhui/code/mmdnn_custom/tests/model/net.pth'); File "demo_pt2caffe.py", line 11, in __init__ self.PytorchParse() File "demo_pt2caffe.py", line 30, in PytorchParse parser = PytorchParser(self.src_model_path[0], [1, 28, 28]) File "/usr/local/lib/python2.7/site-packages/mmdnn/conversion/pytorch/pytorch_parser.py", line 85, in __init__ self.pytorch_graph.build(self.input_shape) File "/usr/local/lib/python2.7/site-packages/mmdnn/conversion/pytorch/pytorch_graph.py", line 125, in build trace, output = torch.jit.get_trace_graph(self.model, (dummy_input, )) File "/usr/local/lib/python2.7/site-packages/torch/jit/__init__.py", line 255, in get_trace_graph return LegacyTracedModule(f, nderivs=nderivs)(*args, **kwargs) File "/usr/local/lib/python2.7/site-packages/torch/nn/modules/module.py", line 491, in __call__ result = self.forward(*input, **kwargs) File "/usr/local/lib/python2.7/site-packages/torch/jit/__init__.py", line 288, in forward out = self.inner(*trace_inputs) File "/usr/local/lib/python2.7/site-packages/torch/nn/modules/module.py", line 489, in __call__ result = self._slow_forward(*input, **kwargs) File "/usr/local/lib/python2.7/site-packages/torch/nn/modules/module.py", line 479, in _slow_forward result = self.forward(*input, **kwargs) File "/mnt/chenhui/code/mmdnn_custom/tests/mnist_test.py", line 67, in forward x = self.abc(x, self.abc) File "/usr/local/lib/python2.7/site-packages/torch/nn/modules/module.py", line 489, in __call__ result = self._slow_forward(*input, **kwargs) File "/usr/local/lib/python2.7/site-packages/torch/nn/modules/module.py", line 466, in _slow_forward input_vars = tuple(torch.autograd.function._iter_tensors(input)) File "/usr/local/lib/python2.7/site-packages/torch/autograd/function.py", line 275, in _iter for var in _iter(o): File "/usr/local/lib/python2.7/site-packages/torch/autograd/function.py", line 284, in _iter if condition_msg else "")) ValueError: Auto nesting doesn't know how to process an input object of type mnist_test.ABC. Accepted types: Tensors, or lists/tuples of them
So, can you tell me how to solve this problem? And how to transfrom network with customer layers from pytorch to IR?
Thank you very much.
The text was updated successfully, but these errors were encountered: