rknn.load_onnx 无法加载onnx模型
报错如下,
--> Loading onnx model
WARNING: ONNX Optimizer has been moved to https://github.com/onnx/optimizer.
All further enhancements and fixes to optimizers will be done in this new repo.
The optimizer code in onnx/onnx repo will be removed in 1.9 release.
这个错误的原因, 暂时不知,
或许与中文路径有关.(后修改发现与中文路径无关)
目前在调试模式下可以正常加载.
错误1.
--> Building model
E Catch exception when building RKNN model!
E Traceback (most recent call last):
E File "rknn\api\rknn_base.py", line 616, in rknn.api.rknn_base.RKNNBase.build
E File "rknn\api\rknn_base.py", line 1478, in rknn.api.rknn_base.RKNNBase._quantize2
E FileNotFoundError: [Errno 2] No such file or directory: 'dataset.txt'
done
E Catch exception when snapshot: UnicodeDecodeError('gbk', b'H:\\project\\\xe4\xba\x8c\xe4\xbb\xa3\xe5\x9e\x83\xe5\x9c\xbe\xe6\xa1\xb6\\\xe4\xb8\xbb\xe7\x95\x8c\xe9\x9d\xa2\\\xe6\xba\x90\xe4\xbb\xa3\xe7\xa0\x81\\npu\xe6\x96\xb9\xe6\xa1\x88\\yolov5_3399pro\\convert2\\50618close_416x416.jpg', 35, 36, 'illegal multibyte sequence')
E Traceback (most recent call last):
E File "rknn\api\rknn_base.py", line 787, in rknn.api.rknn_base.RKNNBase.accuracy_analysis
E UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 35: illegal multibyte sequence
E RKNN model data is None, please load model first!
E RKNN model data is None, please load model first!
Export best.rknn failed!
这是因为dataset.txt的文件编码为utf8引起的, 且.jpg文件的路径中包含中文所致. 两个方法, 一个是把dataset.txt文件的编码改成gbk, 然后重新填入, 另外一个方法是把 .jpg移到非中文目录下.