|
报错如下:
E Catch exception when loading onnx model: /home/macww/hdd/elk/rknn/tmp.onnx!
E Traceback (most recent call last):
E File "rknn/api/rknn_base.py", line 525, in rknn.api.rknn_base.RKNNBase.load_onnx
E File "rknn/api/rknn_base.py", line 1581, in rknn.api.rknn_base.RKNNBase._save_net_to_temp_dir
E File "rknn/base/RKNNlib/RKNNnet.py", line 518, in rknn.base.RKNNlib.RKNNnet.RKNNNet.dump
E FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpjg99n983/torchjitexport.json'
Load failed!
Traceback (most recent call last):
File "/home/macww/hdd/minicao/envs/rknn/lib/python3.6/weakref.py", line 624, in _exitfunc
f()
File "/home/macww/hdd/minicao/envs/rknn/lib/python3.6/weakref.py", line 548, in __call__
return info.func(*info.args, **(info.kwargs or {}))
File "/home/macww/hdd/minicao/envs/rknn/lib/python3.6/tempfile.py", line 799, in _cleanup
_shutil.rmtree(name)
File "/home/macww/hdd/minicao/envs/rknn/lib/python3.6/shutil.py", line 477, in rmtree
onerror(os.lstat, path, sys.exc_info())
File "/home/macww/hdd/minicao/envs/rknn/lib/python3.6/shutil.py", line 475, in rmtree
orig_st = os.lstat(path)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpjg99n983'
代码如下:
rknn = RKNN()
print('--> config model')
rknn.config(channel_mean_value='0 0 0 255', reorder_channel='0 1 2',quantized_dtype="dynamic_fixed_point-8") # V2
print('done')
print('--> Loading model')
ret = rknn.load_onnx(model=ONNX_MODEL)
if ret != 0:
print('Load failed!')
exit(ret)
print('done')
# Build mode
print('--> Building model')
ret = rknn.build(do_quantization=False, dataset='./dataset7.txt')
if ret != 0:
print('Build failed!')
exit(ret)
print('done')
print('--> Export RKNN model')
ret = rknn.export_rknn(RKNN_MODEL)
if ret != 0:
print('Export rknn failed!')
exit(ret)
print('done')
rknn.release()
目前的rknn-tookit版本
问题描述:在多次运行,模型转化代码后,就会出现类似问题。
|
|