|
在之前使用v1.3的固件时,将pb模型转化为rknn是可行的(不会报错)
然后更新了固件为v1.5(Fedora),将pb转rknn时出现如下报错:
eption when loading tensorflow model: ./tensorflow.pb!
T Traceback (most recent call last):
T File "/home/toybrick/.local/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 418, in import_graph_def
T graph._c_graph, serialized, options) # pylint: disable=protected-access
T 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: conv2d_1/convolution = Conv2D[T=DT_FLOAT, data_format="NHWC", dilations=[1, 1, 1, 1], explicit_paddings=[], padding="SAME", strides=[1, 2, 2, 1], use_cudnn_on_gpu=true](input_1, conv2d_1/kernel). (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.).
T During handling of the above exception, another exception occurred:
T Traceback (most recent call last):
T File "rknn/api/rknn_base.py", line 136, in rknn.api.rknn_base.RKNNBase.load_tensorflow
T File "rknn/base/RKNNlib/converter/convert_tf.py", line 488, in rknn.base.RKNNlib.converter.convert_tf.convert_tf.pre_process
T File "rknn/base/RKNNlib/converter/tensorflowloader.py", line 102, in rknn.base.RKNNlib.converter.tensorflowloader.TF_Graph_Preprocess.pre_proces
T File "rknn/base/RKNNlib/converter/tensorflowloader.py", line 629, in rknn.base.RKNNlib.converter.tensorflowloader.TF_Graph_Preprocess.calc_2_const
T File "rknn/base/RKNNlib/converter/tf_util.py", line 371, in rknn.base.RKNNlib.converter.tf_util.TFProto_Util.query_tensor
T File "rknn/base/RKNNlib/converter/tf_util.py", line 372, in rknn.base.RKNNlib.converter.tf_util.TFProto_Util.query_tensor
T File "/home/toybrick/.local/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 454, in new_func
T return func(*args, **kwargs)
T File "/home/toybrick/.local/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 422, in import_graph_def
T raise ValueError(str(e))
T 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: conv2d_1/convolution = Conv2D[T=DT_FLOAT, data_format="NHWC", dilations=[1, 1, 1, 1], explicit_paddings=[], padding="SAME", strides=[1, 2, 2, 1], use_cudnn_on_gpu=true](input_1, conv2d_1/kernel). (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.).
done
--> Building model
Traceback (most recent call last):
File "test.py", line 23, in <module>
rknn.build(do_quantization=False)
File "/home/toybrick/.local/lib/python3.6/site-packages/rknn/api/rknn.py", line 163, in build
inputs = self.rknn_base.net.get_input_layers()
AttributeError: 'NoneType' object has no attribute 'get_input_layers'
这个该如何解决呢?
|
|