Hello,
I am currently trying to use a pytorch model done with pytorch 1.0. I am doing a C++ code to load the model using torch script like this: module = torch::jit::load(net_fn);
First I tried to use JetPack 4.3 with pytorch 1.1 and I successfully used the model.
Now I am trying to use JetPack 4.5 with pytorch 1.8, I did the following sequence:
-
I open load my model with pytorch 1.2 and I saved it again, then with pytorch 1.3, then pytorch 1.5 until getting the model on pytorh 1.8:
gcn2_640x480_conv18.pt (13.9 MB) -
Then I tried to use this model with pytorch 1.8 on Jetson Nano but I got this error:
terminate called after throwing an instance of ‘std::runtime_error’
what(): The following operation failed in the TorchScript interpreter.
Traceback of TorchScript, serialized code (most recent call last):
File “code/torch.py”, line 65, in forward
_14 = torch.to(_11, dtype=4, layout=0, device=torch.device(“cuda:0”), pin_memory=False, non_blocking=False, copy=False, memory_format=None)
_15 = torch.to(_13, dtype=4, layout=0, device=torch.device(“cuda:0”), pin_memory=False, non_blocking=False, copy=False, memory_format=None)
_16 = torch.unsqueeze(torch.index(det, [_14, _15]), 1)
~~~~~~~~~~~ <— HERE
pts = torch.cat([_6, _9, _16], 1)
_17 = torch.slice(pts, 0, 0, 9223372036854775807, 1)
Traceback of TorchScript, original code (most recent call last):
File “code/gcn2_640x480_conv11.py”, line 42, in forward
_12 = torch.to(_9, dtype=4, layout=0, device=torch.device(“cuda:0”), pin_memory=False, non_blocking=False, copy=False)
_13 = torch.to(_11, dtype=4, layout=0, device=torch.device(“cuda:0”), pin_memory=False, non_blocking=False, copy=False)
_14 = torch.unsqueeze(torch.index(det, [_12, _13]), 1)
~~~~~~~~~~~ <— HERE
pts = torch.cat([_4, _7, _14], 1)
_15 = torch.slice(pts, 0, 0, 9223372036854775807, 1)
RuntimeError: Tried to cast a List to a List<Tensor?>. Types mismatch.
./run.sh: line 24: 9346 Aborted (core dumped) ./Examples/Monocular/mono_webcam
Could you please give me some highlights to solve this problem?
Regards.