Hi,
I had run snpe-pytorch-to-dlc on sample resnet18.pt successfully.
But when I run snpe-pytorch-to-dlc on my custom torch script, snpe-pytorch-to-dlc received an c10::Error
The command: (test01.pt was my cuntom torch script file)
snpe-pytorch-to-dlc --input_dim x 1,3,224,224 --input_network test01.pt --output_path test.dlc
Error info:
terminate called after throwing an instance of 'c10::Error'
what(): isTuple() INTERNAL ASSERT FAILED at "/pytorch/aten/src/ATen/core/ivalue_inl.h":1101, please report a bug to PyTorch. Expected Tuple but got String
Exception raised from toTuple at /pytorch/aten/src/ATen/core/ivalue_inl.h:1101 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::string) + 0x42 (0x7f38117212f2 in /usr/local/lib/python3.6/dist-packages/torch/lib/libc10.so)
frame #1: <unknown function> + 0x35ae669 (0x7f3854c50669 in /usr/local/lib/python3.6/dist-packages/torch/lib/libtorch_cpu.so)
frame #2: <unknown function> + 0x35b0de5 (0x7f3854c52de5 in /usr/local/lib/python3.6/dist-packages/torch/lib/libtorch_cpu.so)
frame #3: torch::jit::SourceRange::highlight(std::ostream&) const + 0x38 (0x7f38524c8758 in /usr/local/lib/python3.6/dist-packages/torch/lib/libtorch_cpu.so)
frame #4: torch::jit::ErrorReport::what() const + 0x2c5 (0x7f38524a7845 in /usr/local/lib/python3.6/dist-packages/torch/lib/libtorch_cpu.so)
frame #5: <unknown function> + 0x356c8e (0x7f3863f57c8e in /usr/local/lib/python3.6/dist-packages/torch/lib/libtorch_python.so)
frame #6: <unknown function> + 0x36da50 (0x7f3863f6ea50 in /usr/local/lib/python3.6/dist-packages/torch/lib/libtorch_python.so)
frame #7: python3() [0x507895]
<omitting python frames>
frame #9: python3() [0x504fd4]
frame #10: python3() [0x506d00]
frame #11: python3() [0x5076ed]
frame #13: python3() [0x504fd4]
frame #14: python3() [0x506d00]
frame #15: python3() [0x5076ed]
frame #17: python3() [0x504fd4]
frame #19: python3() [0x592461]
frame #22: python3() [0x504fd4]
frame #24: python3() [0x592461]
frame #25: python3() [0x546e4f]
frame #26: python3() [0x54ec51]
frame #28: python3() [0x507823]
frame #30: python3() [0x5069c8]
frame #31: python3() [0x5076ed]
frame #33: python3() [0x504fd4]
frame #35: python3() [0x634c32]
frame #40: __libc_start_main + 0xe7 (0x7f38873ecc87 in /lib/x86_64-linux-gnu/libc.so.6)
Please any one has encountered same error? How to resolve?
Thanks.
I had run command below but received same error.
snpe-pytorch-to-dlc --input_dim 'input' 1,3,224,224 --input_network test01.pt --output_path test.dlc
What worked for me was recreating the resnet.pt using the correct version of pytorch 1.8.1. It probably had to do with an error of different verisions of pytorch having different model input dimensions.