|
板凳
楼主 |
发表于 2021-6-16 20:16:35
|
只看该作者
root@he-virtual-machine:~/Documents/rknn-toolkit/examples/pytorch/resnet18# python3 test.py
Downloading: "https://download.pytorch.org/models/resnet18-5c106cde.pth" to /home/he/.cache/torch/checkpoints/resnet18-5c106cde.pth
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 44.7M/44.7M [00:09<00:00, 5.03MB/s]
--> config model
done
--> Loading model
/usr/local/lib/python3.6/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
E Syntax error in input! LexToken(NAMED_IDENTIFIER,'__torch__',1,16)
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 740, in rknn.base.RKNNlib.converter.convert_pytorch.convert_pytorch.__init__
E File "rknn/base/RKNNlib/converter/pytorch_parser/pytorch_ir_parser.py", line 554, in rknn.base.RKNNlib.converter.pytorch_parser.pytorch_ir_parser.pytorch_ir_parser.parse
E File "/usr/local/lib/python3.6/dist-packages/ply/yacc.py", line 333, in parse
E return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
E File "/usr/local/lib/python3.6/dist-packages/ply/yacc.py", line 1201, in parseopt_notrack
E tok = call_errorfunc(self.errorfunc, errtoken, self)
E File "/usr/local/lib/python3.6/dist-packages/ply/yacc.py", line 192, in call_errorfunc
E r = errorfunc(token)
E File "rknn/base/RKNNlib/converter/pytorch_parser/pytorch_ir_parser.py", line 545, in rknn.base.RKNNlib.converter.pytorch_parser.pytorch_ir_parser.pytorch_ir_parser.p_error
E File "rknn/api/rknn_log.py", line 312, in rknn.api.rknn_log.RKNNLog.e
E ValueError: Syntax error in input! LexToken(NAMED_IDENTIFIER,'__torch__',1,16)
Load pytorch model failed!
root@he-virtual-machine:~/Documents/rknn-toolkit/examples/pytorch/resnet18# pip3 list | grep torch
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
torch (1.5.1)
torchvision (0.6.1)
root@he-virtual-machine:~/Documents/rknn-toolkit/examples/pytorch/resnet18#
升级了torch (1.5.1)和 torchvision (0.6.1),rknn-toolkit自带的resnet18例子转换都有问题。 |
|