Toybrick

标题: RK3399proD无法跑通pytroch版本test.py [打印本页]

作者: segust    时间: 2020-12-9 15:19
标题: RK3399proD无法跑通pytroch版本test.py
RK3399proD上跑caffe、tensorflow和onnx示例代码都没有问题,唯独跑pytorch里的test.py报错,系统是debian10,rknn-toolkit版本1.4.0,pytorch版本1.12.0,在pc上所有实例都可以跑通,是我系统烧错了吗?
报错内容
--> config model
done
--> Loading model
W:tensorflow:From /home/toybrick/.local/lib/python3.7/site-packages/onnx_tf/handlers/backend/ceil.py:10: The name tf.ceil is deprecated. Please use tf.math.ceil instead.

W:tensorflow:From /home/toybrick/.local/lib/python3.7/site-packages/onnx_tf/handlers/backend/depth_to_space.py:12: The name tf.depth_to_space is deprecated. Please use tf.compat.v1.depth_to_space instead.

W:tensorflow:
The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:
  * https://github.com/tensorflow/co ... 7-contrib-sunset.md
  * https://github.com/tensorflow/addons
  * https://github.com/tensorflow/io (for I/O related ops)
If you depend on functionality not listed there, please file an issue.

W:tensorflow:From /home/toybrick/.local/lib/python3.7/site-packages/onnx_tf/handlers/backend/log.py:10: The name tf.log is deprecated. Please use tf.math.log instead.

W:tensorflow:From /home/toybrick/.local/lib/python3.7/site-packages/onnx_tf/handlers/backend/random_normal.py:9: The name tf.random_normal is deprecated. Please use tf.random.normal instead.

W:tensorflow:From /home/toybrick/.local/lib/python3.7/site-packages/onnx_tf/handlers/backend/random_uniform.py:9: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

W:tensorflow:From /home/toybrick/.local/lib/python3.7/site-packages/onnx_tf/handlers/backend/upsample.py:13: The name tf.image.resize_images is deprecated. Please use tf.image.resize instead.

/home/toybrick/.local/lib/python3.7/site-packages/onnx_tf/common/__init__.py:87: UserWarning: FrontendHandler.get_outputs_names is deprecated. It will be removed in future release.. Use node.outputs instead.
  warnings.warn(message)
./resnet18.pt ********************
WARNING: Token 'COMMENT' defined, but not used
WARNING: There is 1 unused token
E Catch exception when loading pytorch model: ./resnet18.pt!
E Traceback (most recent call last):
E   File "rknn/api/rknn_base.py", line 657, in rknn.api.rknn_base.RKNNBase.load_pytorch
E   File "rknn/base/RKNNlib/app/importer/import_pytorch.py", line 97, in rknn.base.RKNNlib.app.importer.import_pytorch.ImportPytorch.run
E   File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 755, in rknn.base.RKNNlib.converter.convert_pytorch.convert_pytorch.__init__
E   File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 839, in rknn.base.RKNNlib.converter.convert_pytorch.convert_pytorch.model_simplify
E   File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 124, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.shape_pick
E   File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 159, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.__ir_shape_inference
E   File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 398, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.addmm_shape
E   File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 124, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.shape_pick
E   File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 159, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.__ir_shape_inference
E   File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 281, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.view_shape
E ZeroDivisionError: integer division or modulo by zero





作者: segust    时间: 2020-12-9 21:25
解决了,是因为torchvision版本不对,用0.4.0就行了,https://github.com/nmilosev/pytorch-arm-builds




欢迎光临 Toybrick (https://t.rock-chips.com/) Powered by Discuz! X3.3