Toybrick

RK3399Pro tensorflow模型转rknn模型失败

llllll

注册会员

积分
57
楼主
发表于 2021-10-18 11:40:07    查看: 8143|回复: 1 | [复制链接]    打印 | 只看该作者
tensorflow模型转化为rknn模型失败  下面是代码部分,各位帮忙看一下


(venv) ljs@ljs-virtual-machine:~/yolov3_demo$ python3 rknn_transform_416x416.py
--> Loading model
W:tensorflow:From /home/ljs/venv/lib/python3.6/site-packages/rknn/api/rknn.py:136: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.

W:tensorflow:From /home/ljs/venv/lib/python3.6/site-packages/rknn/api/rknn.py:136: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

2021-10-18 10:35:19.926517: E tensorflow/stream_executor/cuda/cuda_driver.cc:318] failed call to cuInit: UNKNOWN ERROR (303)
W:tensorflow:From /home/ljs/venv/lib/python3.6/site-packages/rknn/api/rknn.py:136: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

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 is deprecated. Please use mean_values and std_values to replace it.
W:tensorflow:From /home/ljs/venv/lib/python3.6/site-packages/rknn/api/rknn.py:244: The name tf.reset_default_graph is deprecated. Please use tf.compat.v1.reset_default_graph instead.

W:tensorflow:From /home/ljs/venv/lib/python3.6/site-packages/rknn/api/rknn.py:244: The name tf.FIFOQueue is deprecated. Please use tf.queue.FIFOQueue instead.

W:tensorflow:From /home/ljs/venv/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py:1814: 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, there are two
    options available in V2.
    - tf.py_function 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.
    - tf.numpy_function maintains the semantics of the deprecated tf.py_func
    (it is not differentiable, and manipulates numpy arrays). It drops the
    stateful argument making all functions stateful.
   
2021-10-18 10:38:41.894117: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1412] (One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set.  If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU.  To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile.
/bin/sh: 1: make: not found
/bin/sh: 1: /tmp/tmp1shhxcwp/gen_nbg: not found
mv: 无法获取'/home/ljs/yolov3_demo/*.nb' 的文件状态(stat): 没有那个文件或目录
mv: 无法获取'/home/ljs/yolov3_demo/*.dat' 的文件状态(stat): 没有那个文件或目录
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 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.
done
E RKNN model data is None, please load model first!
E RKNN model data is None, please load model first!


回复

使用道具 举报

kepurSong

中级会员

积分
423
沙发
发表于 2021-10-29 10:58:05 | 只看该作者
你这个问题我也遇见过,主要是模型量化的时候,batch_size太大了,你改小一点
回复

使用道具 举报

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

本版积分规则

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


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