|
在rknn.build设置pre_compile=True后,报错。设置代码节选如下:
- # Build model
- print('--> Building model')
- ret = rknn.build(do_quantization=True, pre_compile=True, dataset='./dataset.txt')
- if ret != 0:
- print('build model failed.')
- exit(ret)
- print('done')
报错结果如下:
- (venv) wenji-G3:~/rv1109/external/rknn-toolkit/examples/darknet/yolov3_rknn$ python test.py
- --> Loading model
- done
- --> Building model
- W The RKNN Model generated can not run on simulator when pre_compile is True.
- make: gcc-linaro-6.3.1-2017.05-i686_aarch64-linux-gnugcc: Command not found
- make: *** [vnn_pre_process.o] Error 127
- /bin/sh: 1: /tmp/tmp0s82ra97/gen_nbg: not found
- mv: 无法获取'/home/rv1109/external/rknn-toolkit/examples/darknet/yolov3_rknn/*.nb' 的文件状态(stat): 没有那个文件或目录
- mv: 无法获取'/home/rv1109/external/rknn-toolkit/examples/darknet/yolov3_rknn/*.dat' 的文件状态(stat): 没有那个文件或目录
- E Generate nbg failed.
- W ----------------Warning(1)----------------
- E Catch exception when building RKNN model!
- E Traceback (most recent call last):
- E File "rknn/base/ovxconfiggenerator.py", line 193, in rknn.base.ovxconfiggenerator.generate_vx_config_from_files
- E File "rknn/base/RKNNlib/app/exporter/ovxlib_case/casegenerator.py", line 632, in rknn.base.RKNNlib.app.exporter.ovxlib_case.casegenerator.CaseGenerator.generate
- E File "rknn/base/RKNNlib/app/exporter/ovxlib_case/casegenerator.py", line 583, in rknn.base.RKNNlib.app.exporter.ovxlib_case.casegenerator.CaseGenerator._gen_special_case
- E File "rknn/base/RKNNlib/app/exporter/ovxlib_case/casegenerator.py", line 548, in rknn.base.RKNNlib.app.exporter.ovxlib_case.casegenerator.CaseGenerator._gen_nb_file
- E AttributeError: 'CaseGenerator' object has no attribute 'nbg_graph_file_path'
- E During handling of the above exception, another exception occurred:
- E Traceback (most recent call last):
- E File "rknn/api/rknn_base.py", line 601, in rknn.api.rknn_base.RKNNBase.build
- E File "rknn/api/rknn_base.py", line 414, in rknn.api.rknn_base.RKNNBase._build
- E File "rknn/base/ovxconfiggenerator.py", line 195, in rknn.base.ovxconfiggenerator.generate_vx_config_from_files
- E File "rknn/api/rknn_log.py", line 312, in rknn.api.rknn_log.RKNNLog.e
- E ValueError: Generate nbg failed.
- build model failed.
/tmp 目录下无 tmp0s82ra97/gen_nbg 请问这个目录文件如何生成的?需要自己添加吗?在sdk中有没有?
/home/rv1109/external/rknn-toolkit/examples/darknet/yolov3_rknn/*.nb'及 /*.dat 两个文件也不存在,这两个文件需要获取吗?如何获取?
看了《Rockchip_Trouble_Shooting_RKNN_Toolkit_V1.4.0_CN.pdf》中关于rknn.build()设置pre_compile=True报错,其中写道需要确认
请确认:
1) 系统装有 gcc 编译工具链
2) 模型的名称只包含“字母”、“数字”、“_”,特别注意有些复制过来的模型名称
会自动加上”(1)”,这时会失败。也可以升级到 1.3.0 或之后的版本,由 RKNN Toolkit 自
动处理这些特殊字符。
如果不属于上述情况,可以尝试使用 export_rknn_precompile_model 接口从板子上导出
预编译模型。 系统为ubuntu18.04装有gcc,rknn-toolkit 1.6.0,
使用export_rknn_precompile_model的代码如下:
- print('--> init runtime')
- # ret = rknn.init_runtime()
- ret = rknn.init_runtime(target='rv1126', device_id='3166854b086a700f', rknn2precompile=True)
- if ret != 0:
- print('init runtime failed.')
- exit(ret)
- print('done')
- print('--> export pre-compile model')
- # Note:the rknn2precompile must be set True when call init_runtime
- ret = rknn.export_rknn_precompile_model('./test_pre_compile.rknn')
- if ret != 0:
- print('export pre-compile model failed.')
- exit(ret)
- rknn.release()
仍然报上述错误,如下所示:
- (venv) wenji-G3:~/rv1109/external/rknn-toolkit/examples/darknet/yolov3_rknn$ python test.py
- --> Loading model
- done
- --> Building model
- W The RKNN Model generated can not run on simulator when pre_compile is True.
- make: gcc-linaro-6.3.1-2017.05-i686_aarch64-linux-gnugcc: Command not found
- make: *** [vnn_pre_process.o] Error 127
- /bin/sh: 1: /tmp/tmp0s82ra97/gen_nbg: not found
- mv: 无法获取'/home/rv1109/external/rknn-toolkit/examples/darknet/yolov3_rknn/*.nb' 的文件状态(stat): 没有那个文件或目录
- mv: 无法获取'/home/rv1109/external/rknn-toolkit/examples/darknet/yolov3_rknn/*.dat' 的文件状态(stat): 没有那个文件或目录
- E Generate nbg failed.
- W ----------------Warning(1)----------------
- E Catch exception when building RKNN model!
- E Traceback (most recent call last):
- E File "rknn/base/ovxconfiggenerator.py", line 193, in rknn.base.ovxconfiggenerator.generate_vx_config_from_files
- E File "rknn/base/RKNNlib/app/exporter/ovxlib_case/casegenerator.py", line 632, in rknn.base.RKNNlib.app.exporter.ovxlib_case.casegenerator.CaseGenerator.generate
- E File "rknn/base/RKNNlib/app/exporter/ovxlib_case/casegenerator.py", line 583, in rknn.base.RKNNlib.app.exporter.ovxlib_case.casegenerator.CaseGenerator._gen_special_case
- E File "rknn/base/RKNNlib/app/exporter/ovxlib_case/casegenerator.py", line 548, in rknn.base.RKNNlib.app.exporter.ovxlib_case.casegenerator.CaseGenerator._gen_nb_file
- E AttributeError: 'CaseGenerator' object has no attribute 'nbg_graph_file_path'
- E During handling of the above exception, another exception occurred:
- E Traceback (most recent call last):
- E File "rknn/api/rknn_base.py", line 601, in rknn.api.rknn_base.RKNNBase.build
- E File "rknn/api/rknn_base.py", line 414, in rknn.api.rknn_base.RKNNBase._build
- E File "rknn/base/ovxconfiggenerator.py", line 195, in rknn.base.ovxconfiggenerator.generate_vx_config_from_files
- E File "rknn/api/rknn_log.py", line 312, in rknn.api.rknn_log.RKNNLog.e
- E ValueError: Generate nbg failed.
- build model failed.
请问这种情况应该如何解决?
|
|