Toybrick

inceptionV3训练出的pb模型,无法转rknn

jandriux

注册会员

积分
90
楼主
发表于 2019-11-1 15:02:42    查看: 7750|回复: 3 | [复制链接]    打印 | 只看该作者
1、模型利用inception_v3训练
2、将ckpt转换了pb
3、但是在rk3399pro开发板上想要将pb转换成rknn的时候报错如下:
E Catch exception when loading tensorflow model: frozen_graph.pb!
E Traceback (most recent call last):
E   File "/usr/local/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 418, in import_graph_def
E     graph._c_graph, serialized, options)  # pylint: disable=protected-access
E tensorflow.python.framework.errors_impl.InvalidArgumentError: NodeDef mentions attr 'explicit_paddings' not in Op<name=Conv2D; signature=input:T, filter:T -> output:T; attr=T:type,allowed=[DT_HALF, DT_BFLOAT16, DT_FLOAT, DT_DOUBLE]; attr=strides:list(int); attr=use_cudnn_on_gpu:bool,default=true; attr=padding:string,allowed=["SAME", "VALID"]; attr=data_format:string,default="NHWC",allowed=["NHWC", "NCHW"]; attr=dilations:list(int),default=[1, 1, 1, 1]>; NodeDef: InceptionV3/InceptionV3/Conv2d_1a_3x3/Conv2D = Conv2D[T=DT_FLOAT, data_format="NHWC", dilations=[1, 1, 1, 1], explicit_paddings=[], padding="VALID", strides=[1, 2, 2, 1], use_cudnn_on_gpu=true](input, InceptionV3/Conv2d_1a_3x3/weights). (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.).
E During handling of the above exception, another exception occurred:
E Traceback (most recent call last):
E   File "rknn/api/rknn_base.py", line 190, in rknn.api.rknn_base.RKNNBase.load_tensorflow
E   File "rknn/base/RKNNlib/converter/convert_tf.py", line 575, in rknn.base.RKNNlib.converter.convert_tf.convert_tf.match_paragraph_and_param
E   File "rknn/base/RKNNlib/converter/convert_tf.py", line 458, in rknn.base.RKNNlib.converter.convert_tf.convert_tf._tf_build_acu_layer
E   File "rknn/base/RKNNlib/converter/convert_tf.py", line 429, in rknn.base.RKNNlib.converter.convert_tf.convert_tf._tf_acu_param_assign
E   File "rknn/base/RKNNlib/converter/convert_tf.py", line 394, in rknn.base.RKNNlib.converter.convert_tf.convert_tf._tf_parse_param
E   File "rknn/base/RKNNlib/converter/convert_tf.py", line 401, in rknn.base.RKNNlib.converter.convert_tf.convert_tf._tf_parase_execute
E   File "<string>", line 1, in <module>
E   File "rknn/base/RKNNlib/converter/convert_tf.py", line 149, in rknn.base.RKNNlib.converter.convert_tf.convert_tf.shape_pick
E   File "rknn/base/RKNNlib/converter/tensorflowloader.py", line 200, in rknn.base.RKNNlib.converter.tensorflowloader.TF_Graph_Preprocess.query_tensors
E   File "rknn/base/RKNNlib/converter/tf_util.py", line 371, in rknn.base.RKNNlib.converter.tf_util.TFProto_Util.query_tensor
E   File "rknn/base/RKNNlib/converter/tf_util.py", line 372, in rknn.base.RKNNlib.converter.tf_util.TFProto_Util.query_tensor
E   File "/usr/local/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 454, in new_func
E     return func(*args, **kwargs)
E   File "/usr/local/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 422, in import_graph_def
E     raise ValueError(str(e))
E ValueError: NodeDef mentions attr 'explicit_paddings' not in Op<name=Conv2D; signature=input:T, filter:T -> output:T; attr=T:type,allowed=[DT_HALF, DT_BFLOAT16, DT_FLOAT, DT_DOUBLE]; attr=strides:list(int); attr=use_cudnn_on_gpu:bool,default=true; attr=padding:string,allowed=["SAME", "VALID"]; attr=data_format:string,default="NHWC",allowed=["NHWC", "NCHW"]; attr=dilations:list(int),default=[1, 1, 1, 1]>; NodeDef: InceptionV3/InceptionV3/Conv2d_1a_3x3/Conv2D = Conv2D[T=DT_FLOAT, data_format="NHWC", dilations=[1, 1, 1, 1], explicit_paddings=[], padding="VALID", strides=[1, 2, 2, 1], use_cudnn_on_gpu=true](input, InceptionV3/Conv2d_1a_3x3/weights). (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.).

请问造成这个问题的原因是什么,是我电脑训练的tensorflow版本为1.14,rk3399pro开发板tensorflow版本为1.10,是版本不兼容吗?但是我之前用cnn写出的模型转换并没有问题。
回复

使用道具 举报

jefferyzhang

版主

积分
13578
沙发
发表于 2019-11-1 15:44:41 | 只看该作者
E   File "/usr/local/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 422, in import_graph_def
报的错是TF的错误,应该是版本不匹配造成的。
为啥非要去板子上转换,你完全可以在你电脑上安装rknn toolkit训练完就可以转rknn了
回复

使用道具 举报

jandriux

注册会员

积分
90
板凳
 楼主| 发表于 2019-11-1 15:48:22 | 只看该作者
jefferyzhang 发表于 2019-11-1 15:44
E   File "/usr/local/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 422, ...

习惯这样了,我回头试一下在电脑上转换,但是之前我写cifar10的时候,版本也是不匹配,那时候为什么没有出现这个问题呢
回复

使用道具 举报

jandriux

注册会员

积分
90
地板
 楼主| 发表于 2019-11-1 16:34:38 | 只看该作者
jefferyzhang 发表于 2019-11-1 15:44
E   File "/usr/local/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 422, ...

我刚电脑安装了rknn toolkit可以正常转换了,应该就是版本的问题了,多谢版主
回复

使用道具 举报

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

本版积分规则

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


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