- net = Net(reid=True)
- model_path = "/home/fly/ai/project/led/deep_sort_pytorch-master/deep_sort/deep/checkpoint/ckpt.t7"
- state_dict = torch.load(model_path, map_location=lambda storage, loc: storage)['net_dict']
- net.load_state_dict(state_dict)
- x = torch.randn(1,3,128,64)
- torch.jit.trace(net, x).save("./deep_sort.pt")
复制代码
- input_size_list = [[3, 128, 64]]
- # Create RKNN object
- rknn = RKNN()
- # pre-process config
- print('--> config model')
- rknn.config(reorder_channel='0 1 2')
- print('done')
- # Load pytorch model
- print('--> Loading model')
- ret = rknn.load_pytorch(model=model, input_size_list=input_size_list)
复制代码
- <p>
- </p><p>/home/fly/ai/project/led/deep_sort_pytorch-master/deep_sort/deep/deep_sort.pt ********************</p><p>WARNING: Token 'COMMENT' defined, but not used</p><p>WARNING: There is 1 unused token</p><p>Load pytorch model failed!</p><p>E Catch exception when loading pytorch model: /home/fly/ai/project/led/deep_sort_pytorch-master/deep_sort/deep/deep_sort.pt!</p><p>E Traceback (most recent call last):</p><p>E File "rknn/api/rknn_base.py", line 657, in rknn.api.rknn_base.RKNNBase.load_pytorch</p><p>E File "rknn/base/RKNNlib/app/importer/import_pytorch.py", line 97, in rknn.base.RKNNlib.app.importer.import_pytorch.ImportPytorch.run</p><p>E File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 755, in rknn.base.RKNNlib.converter.convert_pytorch.convert_pytorch.__init__</p><p>E File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 839, in rknn.base.RKNNlib.converter.convert_pytorch.convert_pytorch.model_simplify</p><p>E File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 124, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.shape_pick</p><p>E File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 159, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.__ir_shape_inference</p><p>E File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 233, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.elementwise_boardcast_shape</p><p>E File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 124, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.shape_pick</p><p>E File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 159, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.__ir_shape_inference</p><p>E File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 281, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.view_shape</p><p>E ZeroDivisionError: integer division or modulo by zero</p>
复制代码
- torch 1.2.0
- torchvision 0.4.0
- rknn-toolkit 1.4.0
复制代码
请问这个除零错误是什么原因呢?欢迎光临 Toybrick (https://t.rock-chips.com/) | Powered by Discuz! X3.3 |