Tenorflow upgraded to 1.9-rc0, generated static graph frozen graph. Pb local test normal, run error NodeDef mentions attr’dilations’not in Op < name = Conv2D under other versions (eg1.4)

NodeDef attr’dilations’not found in the node definition, indicating that the execution version of NodeDef is not on the node definition, two inconsistent, respectivelyExecute inference codeandGenerate static graphsNodes are inconsistent (of course, because the execution environment is different from the generative environment, that is, the version problem).

The solution: If it’s deployed in the cloud, create a model graph in the cloud, and then combine CKPT and graph in the cloud to generate a static graph. If it is embedded, it is to adjust the local version of the same (there may be other reasons can be resolved).

The specific mistakes are:

2018-08-30 22:26:51.668185: E tensorflow/core/common_runtime/executor.cc:643] Executor failed to create kernel. Invalid argument: NodeD
ons attr ‘dilations’ not in Op<name=Conv2D; signature=input:T, filter:T -> output:T; attr=T:type,allowed=[DT_HALF, DT_FLOAT]; attr=stri
(int); attr=use_cudnn_on_gpu:bool,default=true; attr=padding:string,allowed=[“SAME”, “VALID”]; attr=data_format:string,default=”NHWC”,a
“NHWC”, “NCHW”]>; NodeDef: resnet_v1_101/conv1/Conv2D = Conv2D[T=DT_FLOAT, data_format=”NHWC”, dilations=[1, 1, 1, 1], padding=”VALID”,
=[1, 2, 2, 1], use_cudnn_on_gpu=true, _device=”/job:localhost/replica:0/task:0/device:GPU:0″](resnet_v1_101/Pad, resnet_v1_101/conv1/we
(Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.).
     [[Node: resnet_v1_101/conv1/Conv2D = Conv2D[T=DT_FLOAT, data_format=”NHWC”, dilations=[1, 1, 1, 1], padding=”VALID”, strides=[
 1], use_cudnn_on_gpu=true, _device=”/job:localhost/replica:0/task:0/device:GPU:0″](resnet_v1_101/Pad, resnet_v1_101/conv1/weights)]]
Traceback (most recent call last):
  File “time_task_of_belt_detection_new.py”, line 186, in <module>
    tf.app.run()
  File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py”, line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File “time_task_of_belt_detection_new.py”, line 175, in main
    [predictions], feed_dict={image_tensor: image_np_expanded})
  File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py”, line 889, in run
    run_metadata_ptr)
  File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py”, line 1120, in _run
    feed_dict_tensor, options, run_metadata)
  File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py”, line 1317, in _do_run
    options, run_metadata)
  File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py”, line 1336, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: NodeDef mentions attr ‘dilations’ not in Op<name=Conv2D; signature=input:
r:T -> output:T; attr=T:type,allowed=[DT_HALF, DT_FLOAT]; attr=strides:list(int); attr=use_cudnn_on_gpu:bool,default=true; attr=padding
allowed=[“SAME”, “VALID”]; attr=data_format:string,default=”NHWC”,allowed=[“NHWC”, “NCHW”]>; NodeDef: resnet_v1_101/conv1/Conv2D = Conv
FLOAT, data_format=”NHWC”, dilations=[1, 1, 1, 1], padding=”VALID”, strides=[1, 2, 2, 1], use_cudnn_on_gpu=true, _device=”/job:localhos
a:0/task:0/device:GPU:0″](resnet_v1_101/Pad, resnet_v1_101/conv1/weights). (Check whether your GraphDef-interpreting binary is up to da
your GraphDef-generating binary.).
     [[Node: resnet_v1_101/conv1/Conv2D = Conv2D[T=DT_FLOAT, data_format=”NHWC”, dilations=[1, 1, 1, 1], padding=”VALID”, strides=[
 1], use_cudnn_on_gpu=true, _device=”/job:localhost/replica:0/task:0/device:GPU:0″](resnet_v1_101/Pad, resnet_v1_101/conv1/weights)]]

Caused by op u’resnet_v1_101/conv1/Conv2D’, defined at:
  File “time_task_of_belt_detection_new.py”, line 186, in <module>
    tf.app.run()
  File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py”, line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File “time_task_of_belt_detection_new.py”, line 98, in main
    tf.import_graph_def(od_graph_def, name=”)
  File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/importer.py”, line 313, in import_graph_def
    op_def=op_def)
  File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py”, line 2956, in create_op
    op_def=op_def)
  File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py”, line 1470, in __init__
    self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access

InvalidArgumentError (see above for traceback): NodeDef mentions attr ‘dilations’ not in Op<name=Conv2D; signature=input:T, filter:T ->
T; attr=T:type,allowed=[DT_HALF, DT_FLOAT]; attr=strides:list(int); attr=use_cudnn_on_gpu:bool,default=true; attr=padding:string,allowe
“, “VALID”]; attr=data_format:string,default=”NHWC”,allowed=[“NHWC”, “NCHW”]>; NodeDef: resnet_v1_101/conv1/Conv2D = Conv2D[T=DT_FLOAT,
rmat=”NHWC”, dilations=[1, 1, 1, 1], padding=”VALID”, strides=[1, 2, 2, 1], use_cudnn_on_gpu=true, _device=”/job:localhost/replica:0/ta
ice:GPU:0″](resnet_v1_101/Pad, resnet_v1_101/conv1/weights). (Check whether your GraphDef-interpreting binary is up to date with your G
generating binary.).
     [[Node: resnet_v1_101/conv1/Conv2D = Conv2D[T=DT_FLOAT, data_format=”NHWC”, dilations=[1, 1, 1, 1], padding=”VALID”, strides=[
 1], use_cudnn_on_gpu=true, _device=”/job:localhost/replica:0/task:0/device:GPU:0″](resnet_v1_101/Pad, resnet_v1_101/conv1/weights)]]

Leave a Reply

Your email address will not be published. Required fields are marked *