uff.model.exceptions.UffException: Const node conversion requested, but node is not Const

tensort:5.0.2.6
tensorflow:1.9
python 2.7
cuda:9.0
cuDNN:7.3.1
centOS:7.2

detail msg:

attr {
key: “shape”
value {
shape {
}
}
}
]

Using output node LSTMTDNN/output_projection/scores
Converting to UFF graph
Warning: keepdims is ignored by the UFF Parser and defaults to True
Warning: No conversion function registered for layer: Cast yet.
Converting LSTMTDNN/BILSTM/Cast as custom op: Cast
Warning: No conversion function registered for layer: ReverseSequence yet.
Converting LSTMTDNN/BILSTM/ReverseSequence as custom op: ReverseSequence
Warning: No conversion function registered for layer: TensorArrayGatherV3 yet.
Converting LSTMTDNN/BILSTM/bidirectional_rnn/bw/bw/TensorArrayStack/TensorArrayGatherV3 as custom op: TensorArrayGatherV3
Warning: No conversion function registered for layer: Exit yet.
Converting LSTMTDNN/BILSTM/bidirectional_rnn/bw/bw/while/Exit_1 as custom op: Exit
Warning: No conversion function registered for layer: Switch yet.
Converting LSTMTDNN/BILSTM/bidirectional_rnn/bw/bw/while/Switch_1 as custom op: Switch
Warning: No conversion function registered for layer: LoopCond yet.
Converting LSTMTDNN/BILSTM/bidirectional_rnn/bw/bw/while/LoopCond as custom op: LoopCond
Warning: No conversion function registered for layer: Less yet.
Converting LSTMTDNN/BILSTM/bidirectional_rnn/bw/bw/while/Less as custom op: Less
Warning: No conversion function registered for layer: Enter yet.
Converting LSTMTDNN/BILSTM/bidirectional_rnn/bw/bw/while/Less/Enter as custom op: Enter
Warning: No conversion function registered for layer: ReverseSequence yet.
Converting LSTMTDNN/BILSTM/bidirectional_rnn/bw/ReverseSequence as custom op: ReverseSequence
Warning: No conversion function registered for layer: Floor yet.
Converting LSTMTDNN/word_embedding/dropout/Floor as custom op: Floor
Warning: No conversion function registered for layer: RandomUniform yet.
Converting LSTMTDNN/word_embedding/dropout/random_uniform/RandomUniform as custom op: RandomUniform
Warning: No conversion function registered for layer: Merge yet.
Converting LSTMTDNN/BILSTM/bidirectional_rnn/bw/bw/while/Merge as custom op: Merge
Warning: No conversion function registered for layer: NextIteration yet.
Converting LSTMTDNN/BILSTM/bidirectional_rnn/bw/bw/while/NextIteration as custom op: NextIteration
Warning: No conversion function registered for layer: Switch yet.
Converting LSTMTDNN/BILSTM/bidirectional_rnn/bw/bw/while/Switch as custom op: Switch
Warning: No conversion function registered for layer: Enter yet.
Converting LSTMTDNN/BILSTM/bidirectional_rnn/bw/bw/while/Enter as custom op: Enter
Warning: No conversion function registered for layer: Merge yet.
Converting LSTMTDNN/BILSTM/bidirectional_rnn/bw/bw/while/Merge_1 as custom op: Merge
Warning: No conversion function registered for layer: NextIteration yet.
Converting LSTMTDNN/BILSTM/bidirectional_rnn/bw/bw/while/NextIteration_1 as custom op: NextIteration
Warning: No conversion function registered for layer: TensorArrayWriteV3 yet.
Converting LSTMTDNN/BILSTM/bidirectional_rnn/bw/bw/while/TensorArrayWrite/TensorArrayWriteV3 as custom op: TensorArrayWriteV3
Warning: No conversion function registered for layer: Select yet.
Converting LSTMTDNN/BILSTM/bidirectional_rnn/bw/bw/while/Select as custom op: Select
Warning: No conversion function registered for layer: Split yet.
Converting LSTMTDNN/BILSTM/bidirectional_rnn/bw/bw/while/lstm_cell/split as custom op: Split
Traceback (most recent call last):
File “/bin/convert-to-uff”, line 11, in
sys.exit(main())
File “/usr/lib/python2.7/site-packages/uff/bin/convert_to_uff.py”, line 89, in main
debug_mode=args.debug
File “/usr/lib/python2.7/site-packages/uff/converters/tensorflow/conversion_helpers.py”, line 187, in from_tensorflow_frozen_model
return from_tensorflow(graphdef, output_nodes, preprocessor, **kwargs)
File “/usr/lib/python2.7/site-packages/uff/converters/tensorflow/conversion_helpers.py”, line 157, in from_tensorflow
debug_mode=debug_mode)
File “/usr/lib/python2.7/site-packages/uff/converters/tensorflow/converter.py”, line 94, in convert_tf2uff_graph
uff_graph, input_replacements, debug_mode=debug_mode)
File “/usr/lib/python2.7/site-packages/uff/converters/tensorflow/converter.py”, line 79, in convert_tf2uff_node
op, name, tf_node, inputs, uff_graph, tf_nodes=tf_nodes, debug_mode=debug_mode)
File “/usr/lib/python2.7/site-packages/uff/converters/tensorflow/converter.py”, line 47, in convert_layer
return cls.registry_[op](name, tf_node, inputs, uff_graph, **kwargs)
File “/usr/lib/python2.7/site-packages/uff/converters/tensorflow/converter_functions.py”, line 380, in convert_bias_add
kwargs[“tf_nodes”][biases_name])
File “/usr/lib/python2.7/site-packages/uff/converters/tensorflow/converter.py”, line 132, in convert_tf2numpy_const_node
raise UffException(“Const node conversion requested, but node is not Const\n” + str(tf_node))
uff.model.exceptions.UffException: Const node conversion requested, but node is not Const
name: “LSTMTDNN/BILSTM/bidirectional_rnn/bw/bw/while/lstm_cell/lstm_cell_1/BiasAdd/Enter”
op: “Enter”
input: “LSTMTDNN/BILSTM/bidirectional_rnn/bw/lstm_cell/biases”
attr {
key: “T”
value {
type: DT_FLOAT
}
}
attr {
key: “_output_shapes”
value {
list {
shape {
dim {
size: 400
}
}
}
}
}
attr {
key: “frame_name”
value {
s: “LSTMTDNN/BILSTM/bidirectional_rnn/bw/bw/while/LSTMTDNN/BILSTM/bidirectional_rnn/bw/bw/while/”
}
}
attr {
key: “is_constant”
value {
b: true
}
}
attr {
key: “parallel_iterations”
value {
i: 32
}
}

[root@localhost TensorFLowModel]#

without uff file been writen

Hello, It’d help us debug if you can provide a small repro that contains the source and model you are trying to convert to UFF that exhibit this error.

Dear @NVES, I have the same issue as @1147087141, when I convert my graph model with 'convert-to-uff ctpn_model.graph ', I get logs as follows.


Loading ctpn_model.graph
WARNING:tensorflow:From /home/superuser/anaconda3/lib/python3.6/site-packages/uff/converters/tensorflow/conversion_helpers.py:185: FastGFile.__init__ (from tensorflow.python.platform.gfile) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.gfile.GFile.
UFF Version 0.5.5
=== Automatically deduced input nodes ===
[name: "input_1"
op: "Placeholder"
attr {
  key: "dtype"
  value {
    type: DT_FLOAT
  }
}
attr {
  key: "shape"
  value {
    shape {
      dim {
        size: -1
      }
      dim {
        size: 900
      }
      dim {
        size: 900
      }
      dim {
        size: 3
      }
    }
  }
}
]
=========================================

=== Automatically deduced output nodes ===
[name: "rpn_cls_softmax/truediv"
op: "RealDiv"
input: "rpn_cls_softmax/Exp"
input: "rpn_cls_softmax/Sum"
attr {
  key: "T"
  value {
    type: DT_FLOAT
  }
}
, name: "rpn_regress_reshape/Reshape"
op: "Reshape"
input: "rpn_regress/BiasAdd"
input: "rpn_regress_reshape/Reshape/shape"
attr {
  key: "T"
  value {
    type: DT_FLOAT
  }
}
attr {
  key: "Tshape"
  value {
    type: DT_INT32
  }
}
]
==========================================

Using output node rpn_cls_softmax/truediv
Using output node rpn_regress_reshape/Reshape
Converting to UFF graph
Warning: No conversion function registered for layer: ReverseV2 yet.
Converting blstm/ReverseV2_1 as custom op: ReverseV2
Warning: No conversion function registered for layer: TensorArrayGatherV3 yet.
Converting blstm/TensorArrayStack_1/TensorArrayGatherV3 as custom op: TensorArrayGatherV3
Warning: No conversion function registered for layer: Exit yet.
Converting blstm/while_1/Exit_1 as custom op: Exit
Warning: No conversion function registered for layer: Switch yet.
Converting blstm/while_1/Switch_1 as custom op: Switch
Warning: No conversion function registered for layer: LoopCond yet.
Converting blstm/while_1/LoopCond as custom op: LoopCond
Warning: No conversion function registered for layer: Less yet.
Converting blstm/while_1/Less as custom op: Less
Warning: No conversion function registered for layer: Enter yet.
Converting blstm/while_1/Less/Enter as custom op: Enter
Warning: No conversion function registered for layer: ReverseV2 yet.
Converting blstm/ReverseV2 as custom op: ReverseV2
Warning: No conversion function registered for layer: Merge yet.
Converting blstm/while_1/Merge as custom op: Merge
Warning: No conversion function registered for layer: NextIteration yet.
Converting blstm/while_1/NextIteration as custom op: NextIteration
Warning: No conversion function registered for layer: Switch yet.
Converting blstm/while_1/Switch as custom op: Switch
Warning: No conversion function registered for layer: Enter yet.
Converting blstm/while_1/Enter as custom op: Enter
Warning: No conversion function registered for layer: Merge yet.
Converting blstm/while_1/Merge_1 as custom op: Merge
Warning: No conversion function registered for layer: NextIteration yet.
Converting blstm/while_1/NextIteration_1 as custom op: NextIteration
Warning: No conversion function registered for layer: TensorArrayWriteV3 yet.
Converting blstm/while_1/TensorArrayWrite/TensorArrayWriteV3 as custom op: TensorArrayWriteV3
Warning: No conversion function registered for layer: Enter yet.
Converting blstm/while_1/MatMul_5/Enter as custom op: Enter
Warning: No conversion function registered for layer: Switch yet.
Converting blstm/while_1/Switch_2 as custom op: Switch
Warning: No conversion function registered for layer: Merge yet.
Converting blstm/while_1/Merge_2 as custom op: Merge
Warning: No conversion function registered for layer: NextIteration yet.
Converting blstm/while_1/NextIteration_2 as custom op: NextIteration
Warning: No conversion function registered for layer: Enter yet.
Converting blstm/while_1/Enter_2 as custom op: Enter
Warning: No conversion function registered for layer: Tile yet.
Converting blstm/Tile_1 as custom op: Tile
Warning: No conversion function registered for layer: ExpandDims yet.
Converting blstm/ExpandDims_1 as custom op: ExpandDims
Warning: keepdims is ignored by the UFF Parser and defaults to True
Warning: No conversion function registered for layer: ZerosLike yet.
Converting blstm/zeros_like_1 as custom op: ZerosLike
Warning: No conversion function registered for layer: Enter yet.
Converting blstm/while_1/MatMul_4/Enter as custom op: Enter
Traceback (most recent call last):
  File "/home/superuser/anaconda3/bin/convert-to-uff", line 11, in <module>
    sys.exit(main())
  File "/home/superuser/anaconda3/lib/python3.6/site-packages/uff/bin/convert_to_uff.py", line 89, in main
    debug_mode=args.debug
  File "/home/superuser/anaconda3/lib/python3.6/site-packages/uff/converters/tensorflow/conversion_helpers.py", line 187, in from_tensorflow_frozen_model
    return from_tensorflow(graphdef, output_nodes, preprocessor, **kwargs)
  File "/home/superuser/anaconda3/lib/python3.6/site-packages/uff/converters/tensorflow/conversion_helpers.py", line 157, in from_tensorflow
    debug_mode=debug_mode)
  File "/home/superuser/anaconda3/lib/python3.6/site-packages/uff/converters/tensorflow/converter.py", line 94, in convert_tf2uff_graph
    uff_graph, input_replacements, debug_mode=debug_mode)
  File "/home/superuser/anaconda3/lib/python3.6/site-packages/uff/converters/tensorflow/converter.py", line 79, in convert_tf2uff_node
    op, name, tf_node, inputs, uff_graph, tf_nodes=tf_nodes, debug_mode=debug_mode)
  File "/home/superuser/anaconda3/lib/python3.6/site-packages/uff/converters/tensorflow/converter.py", line 47, in convert_layer
    return cls.registry_[op](name, tf_node, inputs, uff_graph, **kwargs)
  File "/home/superuser/anaconda3/lib/python3.6/site-packages/uff/converters/tensorflow/converter_functions.py", line 380, in convert_bias_add
    kwargs["tf_nodes"][biases_name])
  File "/home/superuser/anaconda3/lib/python3.6/site-packages/uff/converters/tensorflow/converter.py", line 132, in convert_tf2numpy_const_node
    raise UffException("Const node conversion requested, but node is not Const\n" + str(tf_node))
uff.model.exceptions.UffException: Const node conversion requested, but node is not Const
name: "blstm/while_1/BiasAdd_1/Enter"
op: "Enter"
input: "blstm/backward_gru_1/strided_slice_7"
attr {
  key: "T"
  value {
    type: DT_FLOAT
  }
}
attr {
  key: "frame_name"
  value {
    s: "blstm/while_1/while_context"
  }
}
attr {
  key: "is_constant"
  value {
    b: true
  }
}
attr {
  key: "parallel_iterations"
  value {
    i: 32
  }
}

My base info is

tensort:5.0.2.6
tensorflow:1.12.0
python 3.5.2
cuda:9.0
cuDNN:7.3.1
Ubuntu 16.04.5 LTS

My model defined as :

x = Conv2D(512, (3, 3), strides=(1, 1), padding='same', activation='relu',
               name='rpn_conv1')(base_layers)
    x1 = Lambda(reshape, output_shape=(None, 512))(x)
    x2 = Bidirectional(GRU(128, return_sequences=True), name='blstm')(x1)  # where blstm i created
    x3 = Lambda(reshape2, output_shape=(None, None, 256))([x2, x])
    x3 = Conv2D(512, (1, 1), padding='same', activation='relu', name='lstm_fc')(x3)
    cls = Conv2D(10 * 2, (1, 1), padding='same', activation='linear', name='rpn_class')(x3)
    regr = Conv2D(10 * 2, (1, 1), padding='same', activation='linear', name='rpn_regress')(x3)
    cls = Lambda(reshape3, output_shape=(None, 2), name='rpn_class_reshape')(cls)
    cls_prod = Activation('softmax', name='rpn_cls_softmax')(cls)
    regr = Lambda(reshape3, output_shape=(None, 2), name='rpn_regress_reshape')(regr)

@NVES can help us problems

I have the same problem ,could you solve it,