|
本帖最后由 zjmmm 于 2020-7-1 15:19 编辑
我这边的一些环境是debian10、rknn-toolkit是1.3.2、pytorch1.2.0、torchvision是0.2.2.post3。
一开始只有一个pth文件,看到文档说pth可能不支持就直接转为pt了,在PC上模型文件可以推导成功。
在板子上rknn.load_pytorch(model='resnet18.pt', input_size_list=[[1,3,720,1280]])这样运行就报了下面的错,请问是哪里有问题吗
[size=13.0667px]--> Loading model
W:tensorflow:From /usr/local/lib/python3.7/dist-packages/onnx_tf/handlers/backend/ceil.py:10: The name tf.ceil is deprecated. Please use tf.math.ceil instead.
W:tensorflow:From /usr/local/lib/python3.7/dist-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 /usr/local/lib/python3.7/dist-packages/onnx_tf/handlers/backend/log.py:10: The name tf.log is deprecated. Please use tf.math.log instead.
W:tensorflow:From /usr/local/lib/python3.7/dist-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 /usr/local/lib/python3.7/dist-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 /usr/local/lib/python3.7/dist-packages/onnx_tf/handlers/backend/upsample.py:13: The name tf.image.resize_images is deprecated. Please use tf.image.resize instead.
/usr/local/lib/python3.7/dist-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
W Not match tensor aten::div_at_2213ut0
E Catch exception when loading pytorch model: resnet18.pt!
E Traceback (most recent call last):
E File "rknn/api/rknn_base.py", line 611, in rknn.api.rknn_base.RKNNBase.load_pytorch
E File "rknn/base/RKNNlib/app/importer/import_pytorch.py", line 104, in rknn.base.RKNNlib.app.importer.import_pytorch.ImportPytorch.run
E File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 1205, in rknn.base.RKNNlib.converter.convert_pytorch.convert_pytorch.match_paragraph_and_param
E File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 1129, in rknn.base.RKNNlib.converter.convert_pytorch.convert_pytorch._torch_push_ready_tensor
E TypeError: 'NoneType' object is not iterable
done
--> Building model
Traceback (most recent call last):
File "transform.py", line 30, in <module>
rknn.build(do_quantization=False)
File "/usr/local/lib/python3.7/dist-packages/rknn/api/rknn.py", line 222, in build
inputs = self.rknn_base.net.get_input_layers()
AttributeError: 'NoneType' object has no attribute 'get_input_layers'
|
|