Toybrick

Darknet-yolov4模型转换为rknn时出错

ynzhang

注册会员

积分
79
楼主
发表于 2020-10-20 15:10:05    查看: 6127|回复: 1 | [复制链接]    打印 | 只看该作者
1. ubuntu16.04物理PC中安装rknn-toolkit-v1.4.0,进行Darknet-yolov4模型转换到rknn出现如下错误:
--> Loading model
done
--> config model
done
--> Building model
W The RKNN Model generated can not run on simulator when pre_compile is True.
W The target_platform is not set in config, using default target platform rk1808.
W The channel_mean_value filed will not be used in the future!
W:tensorflow:From /usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/control_flow_ops.py:3632: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
W:tensorflow:From /usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/control_flow_ops.py:1941: py_func (from tensorflow.python.ops.script_ops) is deprecated and will be removed in a future version.
Instructions for updating:
tf.py_func is deprecated in TF V2. Instead, use
    tf.py_function, which takes a python function which manipulates tf eager
    tensors instead of numpy arrays. It's easy to convert a tf eager tensor to
    an ndarray (just call tensor.numpy()) but having access to eager tensors
    means `tf.py_function`s can use accelerators such as GPUs as well as
    being differentiable using a gradient tape.

cc1: warning: command line option '-std=c++11' is valid for C++/ObjC++ but not for C
vnn_yolov4.c: In function 'vnn_CreateYolov4':
vnn_yolov4.c:209:25: error: 'VSI_NN_OP_MISH' undeclared (first use in this function)
     NEW_VXNODE(node[1], VSI_NN_OP_MISH, 1, 1, 3);
                         ^
vnn_yolov4.c:23:40: note: in definition of macro 'NEW_VXNODE'
         _node = vsi_nn_AddNode( graph, _type, _in, _out, NULL );\
                                        ^
vnn_yolov4.c:209:25: note: each undeclared identifier is reported only once for each function it appears in
     NEW_VXNODE(node[1], VSI_NN_OP_MISH, 1, 1, 3);
                         ^
vnn_yolov4.c:23:40: note: in definition of macro 'NEW_VXNODE'
         _node = vsi_nn_AddNode( graph, _type, _in, _out, NULL );\
                                        ^
make: *** [vnn_yolov4.o] Error 1
/bin/sh: 1: /tmp/tmpuf10lt3v/gen_nbg: not found
mv: cannot stat '/test/yolov4/*.nb': No such file or directory
mv: cannot stat '/test/yolov4/*.dat': No such file or directory
E Generate nbg failed.
W ----------------Warning(3)----------------
E Catch exception when building RKNN model!
E Traceback (most recent call last):
E   File "rknn/base/ovxconfiggenerator.py", line 205, in rknn.base.ovxconfiggenerator.generate_vx_config_from_files
E   File "rknn/base/RKNNlib/app/exporter/ovxlib_case/casegenerator.py", line 543, in rknn.base.RKNNlib.app.exporter.ovxlib_case.casegenerator.CaseGenerator.generate
E   File "rknn/base/RKNNlib/app/exporter/ovxlib_case/casegenerator.py", line 507, 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 474, 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 918, in rknn.api.rknn_base.RKNNBase.build
E   File "rknn/api/rknn_base.py", line 734, in rknn.api.rknn_base.RKNNBase._build
E   File "rknn/base/ovxconfiggenerator.py", line 207, 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 yolov4 failed!


另外查看rknn-toolkit-v1.4.0技术文档,文档中描述已经支持Darknet mish的支持。
其中yolov4.cfg yolov4.weights均使用Darknet官网提供的,我未做过任何修改,请教一下哪位大佬遇到过,能否帮忙指导一下,非常感谢!
回复

使用道具 举报

ynzhang

注册会员

积分
79
沙发
 楼主| 发表于 2020-10-20 16:11:49 | 只看该作者
升级temsorflow到1.13.1,并在转换时将pre_conpile设置为False,即可转换成功。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


快速回复 返回顶部 返回列表