MMdnn icon indicating copy to clipboard operation
MMdnn copied to clipboard

pytorch to IR: , False

Open liuxymvp opened this issue 5 years ago • 2 comments

Run "mmtoir -f pytorch -d resnet101 --inputShape 3,224,224 -n imagenet_resnet101.pth" but get nothing without any error information except ", False" %3517 : int = aten::size(%3515, %3516), scope: ResNet %3520 : int = prim::Constantvalue=-1, scope: ResNet %3521 : int[] = prim::ListConstruct(%3517, %3520), scope: ResNet %input : Float(1, 2048) = aten::view(%3515, %3521), scope: ResNet %3523 : Float(2048!, 1000!) = aten::t(%625), scope: ResNet/Linear[fc] %3524 : int = prim::Constantvalue=1, scope: ResNet/Linear[fc] %3525 : int = prim::Constantvalue=1, scope: ResNet/Linear[fc] %3526 : Float(1, 1000) = aten::addmm(%626, %input, %3523, %3524, %3525), scope: ResNet/Linear[fc] return (%3526); } , False

liuxymvp avatar Jul 10 '20 09:07 liuxymvp

Hi @liuxymvp, what's your torch version? MMdnn 0.3.0 only support torch 0.4.0 currently. You can find our requirements in requirements\linux-py3.txt

XiaoXYe avatar Jul 10 '20 14:07 XiaoXYe

Hi @liuxymvp, what's your torch version? MMdnn 0.3.0 only support torch 0.4.0 currently. You can find our requirements in requirements\linux-py3.txt

I build a docker container by the image 'mmdnn/mmdnn:cpu.small', the pytorch resnet18 model can be converted to IR, but the resnet101 and alexnet failed, error message : /usr/local/lib/python3.5/dist-packages/torch/serialization.py:367: SourceChangeWarning: source code of class 'torch.nn.modules.container.Sequential' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes. warnings.warn(msg, SourceChangeWarning) /usr/local/lib/python3.5/dist-packages/torch/serialization.py:367: SourceChangeWarning: source code of class 'torch.nn.modules.conv.Conv2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes. warnings.warn(msg, SourceChangeWarning) Traceback (most recent call last): File "/usr/local/bin/mmtoir", line 11, in sys.exit(_main()) File "/usr/local/lib/python3.5/dist-packages/mmdnn/conversion/_script/convertToIR.py", line 184, in _main ret = _convert(args) File "/usr/local/lib/python3.5/dist-packages/mmdnn/conversion/_script/convertToIR.py", line 79, in _convert parser = PytorchParser(args.network, inputshape) File "/usr/local/lib/python3.5/dist-packages/mmdnn/conversion/pytorch/pytorch_parser.py", line 71, in init model = torch.load(model_file_name) File "/usr/local/lib/python3.5/dist-packages/torch/serialization.py", line 303, in load return _load(f, map_location, pickle_module) File "/usr/local/lib/python3.5/dist-packages/torch/serialization.py", line 469, in _load result = unpickler.load() AttributeError: Can't get attribute '_rebuild_parameter' on <module 'torch._utils' from '/usr/local/lib/python3.5/dist-packages/torch/_utils.py'>

liuxymvp avatar Jul 13 '20 02:07 liuxymvp