Converting TF Model to TensorRT UFF Format

I am following the official TensorRT Developer Guide(Developer Guide :: NVIDIA Deep Learning TensorRT Documentation) and this Nvidia Tuturial (https://devblogs.nvidia.com/parallelforall/tensorrt-3-faster-tensorflow-inference/) to convert a tf Model to TensorRT UFF Format.

# Load your newly created Tensorflow frozen model and convert it to UFF
uff_model = uff.from_tensorflow_frozen_model("keras_vgg19_frozen_graph.pb", ["dense_2/Softmax"])

what is the second argument for this function? Input or Output Node?
When i run this same code i get following error:

File "/usr/lib/python2.7/dist-packages/uff/converters/tensorflow/converter.py", line 42, in convert_tf2uff_node
    tf_node = tf_nodes[name]

KeyError: 'dense_2/Softmax'

i tried it with

["fc2/Relu"]

but same result. Is there any docu which arguments are valid?

Hi gustavvz,

It seems like the output node names are not in the TensorFlow graph. It may help to use the tensorboard visualization tool to visualize the TensorFlow graph and determine the output name. For example, by running

import keras
import keras.backend as K
import tensorflow as tf

vgg = keras.applications.vgg19.VGG19()
sess = K.get_session()
tf.summary.FileWriter('tensorboard_logdir', sess.graph_def)

You may then visualize the graph by launching $ tensorboard --logdir=tensorboard_logdir. For me, the output node name was ‘predictions/Softmax’. Using this name I was able to freeze the graph and convert to uff as follows.

import keras
import keras.backend as K
import tensorflow as tf
import uff

output_names = ['predictions/Softmax']
frozen_graph_filename = 'keras_vgg19_frozen_graph.pb'
sess = K.get_session()

# freeze graph and remove training nodes
graph_def = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, output_names)
graph_def = tf.graph_util.remove_training_nodes(graph_def)

# write frozen graph to file
with open(frozen_graph_filename, 'wb') as f:
    f.write(graph_def.SerializeToString())
f.close()

# convert frozen graph to uff
uff_model = uff.from_tensorflow_frozen_model(frozen_graph_filename, output_names)

(Keras 2.1.2, TensorFlow 1.4.1, uff 0.2.0)

Hope this helps.

John

1 Like

Hey John thank you very much.

I am trying to do the same for a frozen Model from Googles Object Detection API “Model Zoo”

Can you tell me how to reproduce this code for a Tensorflow only (without any keras) Model?

EDIT:
I made a short script how to import a Forzen Model to Tensorboard. Could be interesting for checking used nodes to verify if TensorRT can handle them.
https://github.com/GustavZ/realtime_object_detection/blob/master/frozenmodel_to_tensorboard.py

EDIT2:
This is the Grpah to the Model i use (SSD_Mobilenet)

Can you tell me which is the Output node as i am not really familiar with tensorboard.

Hi,

From the TensorBoard data you shared in #3, your output node name should be detectio….

Here is a useful script to check a .pb file for your reference:
[url]https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/tools/freeze_graph.py[/url]

Thanks.

I am getting an error (specified bellow) when I run the freeze_graph.py

======= Error ==========

WARNING:tensorflow:From /home/gautam/TensorFlow/tensorflow-master/bazel-bin/tensorflow/python/tools/freeze_graph.runfiles/org_tensorflow/tensorflow/contrib/learn/python/learn/datasets/base.py:198: retry (from tensorflow.contrib.learn.python.learn.datasets.base) is deprecated and will be removed in a future version.
Instructions for updating:
Use the retry module or similar alternatives.
Traceback (most recent call last):
File “/home/gautam/TensorFlow/tensorflow-master/bazel-bin/tensorflow/python/tools/freeze_graph.runfiles/org_tensorflow/tensorflow/python/tools/freeze_graph.py”, line 382, in
run_main()
File “/home/gautam/TensorFlow/tensorflow-master/bazel-bin/tensorflow/python/tools/freeze_graph.runfiles/org_tensorflow/tensorflow/python/tools/freeze_graph.py”, line 379, in run_main
app.run(main=my_main, argv=[sys.argv[0]] + unparsed)
File “/home/gautam/TensorFlow/tensorflow-master/bazel-bin/tensorflow/python/tools/freeze_graph.runfiles/org_tensorflow/tensorflow/python/platform/app.py”, line 126, in run
_sys.exit(main(argv))
File “/home/gautam/TensorFlow/tensorflow-master/bazel-bin/tensorflow/python/tools/freeze_graph.runfiles/org_tensorflow/tensorflow/python/tools/freeze_graph.py”, line 378, in
my_main = lambda unused_args: main(unused_args, flags)
File “/home/gautam/TensorFlow/tensorflow-master/bazel-bin/tensorflow/python/tools/freeze_graph.runfiles/org_tensorflow/tensorflow/python/tools/freeze_graph.py”, line 272, in main
flags.saved_model_tags, checkpoint_version)
File “/home/gautam/TensorFlow/tensorflow-master/bazel-bin/tensorflow/python/tools/freeze_graph.runfiles/org_tensorflow/tensorflow/python/tools/freeze_graph.py”, line 231, in freeze_graph
input_graph_def = _parse_input_graph_proto(input_graph, input_binary)
File “/home/gautam/TensorFlow/tensorflow-master/bazel-bin/tensorflow/python/tools/freeze_graph.runfiles/org_tensorflow/tensorflow/python/tools/freeze_graph.py”, line 174, in _parse_input_graph_proto
text_format.Merge(f.read(), input_graph_def)
File “/home/gautam/.cache/bazel/_bazel_gautam/eb9b2e55e49b116d67448eab2a287112/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/tools/freeze_graph.runfiles/protobuf_archive/python/google/protobuf/text_format.py”, line 533, in Merge
descriptor_pool=descriptor_pool)
File “/home/gautam/.cache/bazel/_bazel_gautam/eb9b2e55e49b116d67448eab2a287112/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/tools/freeze_graph.runfiles/protobuf_archive/python/google/protobuf/text_format.py”, line 587, in MergeLines
return parser.MergeLines(lines, message)
File “/home/gautam/.cache/bazel/_bazel_gautam/eb9b2e55e49b116d67448eab2a287112/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/tools/freeze_graph.runfiles/protobuf_archive/python/google/protobuf/text_format.py”, line 620, in MergeLines
self._ParseOrMerge(lines, message)
File “/home/gautam/.cache/bazel/_bazel_gautam/eb9b2e55e49b116d67448eab2a287112/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/tools/freeze_graph.runfiles/protobuf_archive/python/google/protobuf/text_format.py”, line 635, in _ParseOrMerge
self._MergeField(tokenizer, message)
File “/home/gautam/.cache/bazel/_bazel_gautam/eb9b2e55e49b116d67448eab2a287112/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/tools/freeze_graph.runfiles/protobuf_archive/python/google/protobuf/text_format.py”, line 679, in _MergeField
name = tokenizer.ConsumeIdentifierOrNumber()
File “/home/gautam/.cache/bazel/_bazel_gautam/eb9b2e55e49b116d67448eab2a287112/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/tools/freeze_graph.runfiles/protobuf_archive/python/google/protobuf/text_format.py”, line 1152, in ConsumeIdentifierOrNumber
raise self.ParseError(‘Expected identifier or number, got %s.’ % result)
google.protobuf.text_format.ParseError: 2:1 : Expected identifier or number, got `.

Any help will be appreciated .

Hi,

Looks like this error is from TensorFlow parser when importing the given model.
It’s recommended to share your issue to TensorFlower to get more information.

Thanks.

Hello,

I was able to solve the problem by modifying the code a bit.

Thanks.

@gautam.patel, can you please share the code you used to solve your problem?

How were you able to fix it?? I’m facing the same issue…

Hi,

I have the same issue. summarize_graph tool reports the right output node (‘ssd_losses/softmax/Softmax’) but the script at #2 returns an error saying AssertionError: ssd_losses/softmax/Softmax is not in graph

BTW, I was converting SSD pb file (GitHub - balancap/SSD-Tensorflow: Single Shot MultiBox Detector in TensorFlow)

Hello @AastaLLL

Converting TF Model to TensorRT Engine

import keras
import keras.backend as K
import tensorflow as tf
import uff

output_names = [‘predictions/Softmax’]
frozen_graph_filename = ‘frozen_inference_graph.pb’
sess = K.get_session()

freeze graph and remove training nodes

graph_def = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, output_names)
graph_def = tf.graph_util.remove_training_nodes(graph_def)

write frozen graph to file

with open(frozen_graph_filename, ‘wb’) as f:
f.write(graph_def.SerializeToString())
f.close()

convert frozen graph to uff

uff_model = uff.from_tensorflow_frozen_model(frozen_graph_filename, output_names)
G_LOGGER = trt.infer.ConsoleLogger(trt.infer.LogSeverity.ERROR)
parser = uffparser.create_uff_parser()
parser.register_input(“Placeholder”, (1,28,28), 0)
parser.register_output(“fc2/Relu”)
engine = trt.utils.uff_to_trt_engine(G_LOGGER, uff_model, parser, 1, 1 << 20)
parser.destroy()
runtime = trt.infer.create_infer_runtime(G_LOGGER)
context = engine.create_execution_context()
output = np.empty(10, dtype = np.float32)

Alocate device memory

d_input = cuda.mem_alloc(1 * img.nbytes)
d_output = cuda.mem_alloc(1 * output.nbytes)

bindings = [int(d_input), int(d_output)]
stream = cuda.Stream()

Transfer input data to device

cuda.memcpy_htod_async(d_input, img, stream)

Execute model

context.enqueue(1, bindings, stream.handle, None)

Transfer predictions back

cuda.memcpy_dtoh_async(output, d_output, stream)

Syncronize threads

stream.synchronize()
print(“Test Case: " + str(label))
print (“Prediction: " + str(np.argmax(output)))
trt.utils.write_engine_to_file(”./tf_mnist.engine”, engine.serialize())

list of pakages
Linux:16
Cuda:9.0
tensorRt:4
Python 3.5
Gpu:Gtx 1080
Tensorflow:1.10.1

Error

Traceback (most recent call last):
File “bbb.py”, line 11, in
graph_def = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, output_names)
File “/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/graph_util_impl.py”, line 232, in convert_variables_to_constants
inference_graph = extract_sub_graph(input_graph_def, output_node_names)
File “/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/graph_util_impl.py”, line 174, in extract_sub_graph
_assert_nodes_are_present(name_to_node, dest_nodes)
File “/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/graph_util_impl.py”, line 133, in _assert_nodes_are_present
assert d in name_to_node, “%s is not in graph” % d
AssertionError: predictions/Softmax is not in graph

OR please suggest me any code which convert tensorflow frozen graph(frozen_inference_graph.pb) to trt engine for object detection task

Hi,

This error occurs when TensorFlow loading your model. Not related to the TensorRT.
Please make sure you have a layer named as ‘predictions/Softmax’ in your model.

If you don’t know the layer name of your model, here is a script for your reference:

import tensorflow as tf

FILE = 'frozen_inference_graph.pb'

graph = tf.Graph()
with graph.as_default():
  od_graph_def = tf.GraphDef()
  with tf.gfile.GFile(FILE, 'rb') as fid:
    serialized_graph = fid.read()
    od_graph_def.ParseFromString(serialized_graph)
    tf.import_graph_def(od_graph_def, name='')

  sess = tf.Session()
  op = sess.graph.get_operations()

  for m in op:
    print m.values()

Thanks.

I’m encountering the same problem, but I’ve verified the node name DOES exist in the GraphDef.

def convert_from_frozen_graph(modelpath):
    tf_model = get_frozen_graph(modelpath)
    #pprint.pprint([n.name for n in tf_model.node])
    print(tf_model.node[-1])
    uff_model = uff.from_tensorflow_frozen_model(modelpath, ["output"])
    parser = uffparser.create_uff_parser()
    parser.register_input("input", (None, None, None, 3), 0)
    parser.register_output("output")

Console output:

name: "output"
op: "Identity"
input: "concat_1"
attr {
  key: "T"
  value {
    type: DT_FLOAT
  }
}

Using output node output
Converting to UFF graph
Traceback (most recent call last):
  File "convert_to_tensorrt.py", line 57, in <module>
    convert_from_frozen_graph(FLAGS.input_file)
  File "convert_to_tensorrt.py", line 44, in convert_from_frozen_graph
    uff_model = uff.from_tensorflow_frozen_model(modelpath, ["output"])
  File "/usr/lib/python2.7/dist-packages/uff/converters/tensorflow/conversion_helpers.py", line 149, in from_tensorflow_frozen_model
    return from_tensorflow(graphdef, output_nodes, preprocessor, **kwargs)
  File "/usr/lib/python2.7/dist-packages/uff/converters/tensorflow/conversion_helpers.py", line 120, in from_tensorflow
    name="main")
  File "/usr/lib/python2.7/dist-packages/uff/converters/tensorflow/converter.py", line 77, in convert_tf2uff_graph
    uff_graph, input_replacements)
  File "/usr/lib/python2.7/dist-packages/uff/converters/tensorflow/converter.py", line 54, in convert_tf2uff_node
    raise UffException(str(name) + " was not found in the graph. Please use the -l option to list nodes in the graph.")
uff.model.exceptions.UffException: output was not found in the graph. Please use the -l option to list nodes in the graph.

Hi,

Could you share the result of the script shared in comment #12?
Sometime the layer name will be wrapped with name_scope.

Thanks.

Thanks @AastaLLL I have same issue like @zacwite
This is out_put of #12

(<tf.Tensor ‘images:0’ shape=(?, 128, 64, 3) dtype=uint8>,)
(<tf.Tensor ‘Cast:0’ shape=(?, 128, 64, 3) dtype=float32>,)
(<tf.Tensor ‘map/Shape:0’ shape=(4,) dtype=int32>,)
(<tf.Tensor ‘map/strided_slice/stack:0’ shape=(1,) dtype=int32>,)
(<tf.Tensor ‘map/strided_slice/stack_1:0’ shape=(1,) dtype=int32>,)
(<tf.Tensor ‘map/strided_slice/stack_2:0’ shape=(1,) dtype=int32>,)
(<tf.Tensor ‘map/strided_slice:0’ shape=() dtype=int32>,)
(<tf.Tensor ‘map/TensorArray:0’ shape=(2,) dtype=resource>, <tf.Tensor ‘map/TensorArray:1’ shape=() dtype=float32>)
(<tf.Tensor ‘map/TensorArrayUnstack/Shape:0’ shape=(4,) dtype=int32>,)
(<tf.Tensor ‘map/TensorArrayUnstack/strided_slice/stack:0’ shape=(1,) dtype=int32>,)
(<tf.Tensor ‘map/TensorArrayUnstack/strided_slice/stack_1:0’ shape=(1,) dtype=int32>,)
(<tf.Tensor ‘map/TensorArrayUnstack/strided_slice/stack_2:0’ shape=(1,) dtype=int32>,)
(<tf.Tensor ‘map/TensorArrayUnstack/strided_slice:0’ shape=() dtype=int32>,)
(<tf.Tensor ‘map/TensorArrayUnstack/range/start:0’ shape=() dtype=int32>,)
(<tf.Tensor ‘map/TensorArrayUnstack/range/delta:0’ shape=() dtype=int32>,)
(<tf.Tensor ‘map/TensorArrayUnstack/range:0’ shape=(?,) dtype=int32>,)
(<tf.Tensor ‘map/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3:0’ shape=() dtype=float32>,)
(<tf.Tensor ‘map/Const:0’ shape=() dtype=int32>,)
(<tf.Tensor ‘map/TensorArray_1:0’ shape=(2,) dtype=resource>, <tf.Tensor ‘map/TensorArray_1:1’ shape=() dtype=float32>)
(<tf.Tensor ‘map/while/Enter:0’ shape= dtype=int32>,)
(<tf.Tensor ‘map/while/Enter_1:0’ shape= dtype=float32>,)
(<tf.Tensor ‘map/while/Merge:0’ shape= dtype=int32>, <tf.Tensor ‘map/while/Merge:1’ shape=() dtype=int32>)
(<tf.Tensor ‘map/while/Merge_1:0’ shape= dtype=float32>, <tf.Tensor ‘map/while/Merge_1:1’ shape=() dtype=int32>)
(<tf.Tensor ‘map/while/Less/Enter:0’ shape=() dtype=int32>,)
(<tf.Tensor ‘map/while/Less:0’ shape= dtype=bool>,)
(<tf.Tensor ‘map/while/LoopCond:0’ shape=() dtype=bool>,)
(<tf.Tensor ‘map/while/Switch:0’ shape= dtype=int32>, <tf.Tensor ‘map/while/Switch:1’ shape= dtype=int32>)
(<tf.Tensor ‘map/while/Switch_1:0’ shape= dtype=float32>, <tf.Tensor ‘map/while/Switch_1:1’ shape= dtype=float32>)
(<tf.Tensor ‘map/while/Identity:0’ shape= dtype=int32>,)
(<tf.Tensor ‘map/while/Identity_1:0’ shape= dtype=float32>,)
(<tf.Tensor ‘map/while/TensorArrayReadV3/Enter:0’ shape=(2,) dtype=resource>,)
(<tf.Tensor ‘map/while/TensorArrayReadV3/Enter_1:0’ shape=() dtype=float32>,)
(<tf.Tensor ‘map/while/TensorArrayReadV3:0’ shape= dtype=float32>,)
(<tf.Tensor ‘map/while/strided_slice/stack:0’ shape=(3,) dtype=int32>,)
(<tf.Tensor ‘map/while/strided_slice/stack_1:0’ shape=(3,) dtype=int32>,)
(<tf.Tensor ‘map/while/strided_slice/stack_2:0’ shape=(3,) dtype=int32>,)
(<tf.Tensor ‘map/while/strided_slice:0’ shape= dtype=float32>,)
(<tf.Tensor ‘map/while/TensorArrayWrite/TensorArrayWriteV3/Enter:0’ shape=(2,) dtype=resource>,)
(<tf.Tensor ‘map/while/TensorArrayWrite/TensorArrayWriteV3:0’ shape=() dtype=float32>,)
(<tf.Tensor ‘map/while/add/y:0’ shape=() dtype=int32>,)
(<tf.Tensor ‘map/while/add:0’ shape= dtype=int32>,)
(<tf.Tensor ‘map/while/NextIteration:0’ shape= dtype=int32>,)
(<tf.Tensor ‘map/while/NextIteration_1:0’ shape=() dtype=float32>,)
(<tf.Tensor ‘map/while/Exit_1:0’ shape= dtype=float32>,)
(<tf.Tensor ‘map/TensorArrayStack/TensorArraySizeV3:0’ shape=() dtype=int32>,)
(<tf.Tensor ‘map/TensorArrayStack/range/start:0’ shape=() dtype=int32>,)
(<tf.Tensor ‘map/TensorArrayStack/range/delta:0’ shape=() dtype=int32>,)
(<tf.Tensor ‘map/TensorArrayStack/range:0’ shape=(?,) dtype=int32>,)
(<tf.Tensor ‘map/TensorArrayStack/TensorArrayGatherV3:0’ shape=(?, 128, 64, 3) dtype=float32>,)
(<tf.Tensor ‘conv1_1/weights:0’ shape=(3, 3, 3, 32) dtype=float32>,)
(<tf.Tensor ‘conv1_1/weights/read:0’ shape=(3, 3, 3, 32) dtype=float32>,)
(<tf.Tensor ‘conv1_1/Conv2D:0’ shape=(?, 128, 64, 32) dtype=float32>,)
(<tf.Tensor ‘conv1_1/conv1_1/bn/Const:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv1_1/conv1_1/bn/beta:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv1_1/conv1_1/bn/beta/read:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv1_1/conv1_1/bn/moving_mean:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv1_1/conv1_1/bn/moving_mean/read:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv1_1/conv1_1/bn/moving_variance:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv1_1/conv1_1/bn/moving_variance/read:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv1_1/conv1_1/bn/FusedBatchNorm:0’ shape=(?, 128, 64, 32) dtype=float32>, <tf.Tensor ‘conv1_1/conv1_1/bn/FusedBatchNorm:1’ shape=(32,) dtype=float32>, <tf.Tensor ‘conv1_1/conv1_1/bn/FusedBatchNorm:2’ shape=(32,) dtype=float32>, <tf.Tensor ‘conv1_1/conv1_1/bn/FusedBatchNorm:3’ shape=(32,) dtype=float32>, <tf.Tensor ‘conv1_1/conv1_1/bn/FusedBatchNorm:4’ shape=(32,) dtype=float32>)
(<tf.Tensor ‘conv1_1/Elu:0’ shape=(?, 128, 64, 32) dtype=float32>,)
(<tf.Tensor ‘conv1_2/weights:0’ shape=(3, 3, 32, 32) dtype=float32>,)
(<tf.Tensor ‘conv1_2/weights/read:0’ shape=(3, 3, 32, 32) dtype=float32>,)
(<tf.Tensor ‘conv1_2/Conv2D:0’ shape=(?, 128, 64, 32) dtype=float32>,)
(<tf.Tensor ‘conv1_2/conv1_2/bn/Const:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv1_2/conv1_2/bn/beta:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv1_2/conv1_2/bn/beta/read:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv1_2/conv1_2/bn/moving_mean:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv1_2/conv1_2/bn/moving_mean/read:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv1_2/conv1_2/bn/moving_variance:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv1_2/conv1_2/bn/moving_variance/read:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv1_2/conv1_2/bn/FusedBatchNorm:0’ shape=(?, 128, 64, 32) dtype=float32>, <tf.Tensor ‘conv1_2/conv1_2/bn/FusedBatchNorm:1’ shape=(32,) dtype=float32>, <tf.Tensor ‘conv1_2/conv1_2/bn/FusedBatchNorm:2’ shape=(32,) dtype=float32>, <tf.Tensor ‘conv1_2/conv1_2/bn/FusedBatchNorm:3’ shape=(32,) dtype=float32>, <tf.Tensor ‘conv1_2/conv1_2/bn/FusedBatchNorm:4’ shape=(32,) dtype=float32>)
(<tf.Tensor ‘conv1_2/Elu:0’ shape=(?, 128, 64, 32) dtype=float32>,)
(<tf.Tensor ‘pool1/MaxPool:0’ shape=(?, 63, 31, 32) dtype=float32>,)
(<tf.Tensor ‘conv2_1/1/weights:0’ shape=(3, 3, 32, 32) dtype=float32>,)
(<tf.Tensor ‘conv2_1/1/weights/read:0’ shape=(3, 3, 32, 32) dtype=float32>,)
(<tf.Tensor ‘conv2_1/1/Conv2D:0’ shape=(?, 63, 31, 32) dtype=float32>,)
(<tf.Tensor ‘conv2_1/1/conv2_1/1/bn/Const:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_1/1/conv2_1/1/bn/beta:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_1/1/conv2_1/1/bn/beta/read:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_1/1/conv2_1/1/bn/moving_mean:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_1/1/conv2_1/1/bn/moving_mean/read:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_1/1/conv2_1/1/bn/moving_variance:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_1/1/conv2_1/1/bn/moving_variance/read:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_1/1/conv2_1/1/bn/FusedBatchNorm:0’ shape=(?, 63, 31, 32) dtype=float32>, <tf.Tensor ‘conv2_1/1/conv2_1/1/bn/FusedBatchNorm:1’ shape=(32,) dtype=float32>, <tf.Tensor ‘conv2_1/1/conv2_1/1/bn/FusedBatchNorm:2’ shape=(32,) dtype=float32>, <tf.Tensor ‘conv2_1/1/conv2_1/1/bn/FusedBatchNorm:3’ shape=(32,) dtype=float32>, <tf.Tensor ‘conv2_1/1/conv2_1/1/bn/FusedBatchNorm:4’ shape=(32,) dtype=float32>)
(<tf.Tensor ‘conv2_1/1/Elu:0’ shape=(?, 63, 31, 32) dtype=float32>,)
(<tf.Tensor ‘Dropout/Identity:0’ shape=(?, 63, 31, 32) dtype=float32>,)
(<tf.Tensor ‘conv2_1/2/weights:0’ shape=(3, 3, 32, 32) dtype=float32>,)
(<tf.Tensor ‘conv2_1/2/weights/read:0’ shape=(3, 3, 32, 32) dtype=float32>,)
(<tf.Tensor ‘conv2_1/2/biases:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_1/2/biases/read:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_1/2/Conv2D:0’ shape=(?, 63, 31, 32) dtype=float32>,)
(<tf.Tensor ‘conv2_1/2/BiasAdd:0’ shape=(?, 63, 31, 32) dtype=float32>,)
(<tf.Tensor ‘add:0’ shape=(?, 63, 31, 32) dtype=float32>,)
(<tf.Tensor ‘conv2_3/bn/Const:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_3/bn/beta:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_3/bn/beta/read:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_3/bn/moving_mean:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_3/bn/moving_mean/read:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_3/bn/moving_variance:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_3/bn/moving_variance/read:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_3/bn/FusedBatchNorm:0’ shape=(?, 63, 31, 32) dtype=float32>, <tf.Tensor ‘conv2_3/bn/FusedBatchNorm:1’ shape=(32,) dtype=float32>, <tf.Tensor ‘conv2_3/bn/FusedBatchNorm:2’ shape=(32,) dtype=float32>, <tf.Tensor ‘conv2_3/bn/FusedBatchNorm:3’ shape=(32,) dtype=float32>, <tf.Tensor ‘conv2_3/bn/FusedBatchNorm:4’ shape=(32,) dtype=float32>)
(<tf.Tensor ‘Elu:0’ shape=(?, 63, 31, 32) dtype=float32>,)
(<tf.Tensor ‘conv2_3/1/weights:0’ shape=(3, 3, 32, 32) dtype=float32>,)
(<tf.Tensor ‘conv2_3/1/weights/read:0’ shape=(3, 3, 32, 32) dtype=float32>,)
(<tf.Tensor ‘conv2_3/1/Conv2D:0’ shape=(?, 63, 31, 32) dtype=float32>,)
(<tf.Tensor ‘conv2_3/1/conv2_3/1/bn/Const:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_3/1/conv2_3/1/bn/beta:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_3/1/conv2_3/1/bn/beta/read:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_3/1/conv2_3/1/bn/moving_mean:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_3/1/conv2_3/1/bn/moving_mean/read:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_3/1/conv2_3/1/bn/moving_variance:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_3/1/conv2_3/1/bn/moving_variance/read:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_3/1/conv2_3/1/bn/FusedBatchNorm:0’ shape=(?, 63, 31, 32) dtype=float32>, <tf.Tensor ‘conv2_3/1/conv2_3/1/bn/FusedBatchNorm:1’ shape=(32,) dtype=float32>, <tf.Tensor ‘conv2_3/1/conv2_3/1/bn/FusedBatchNorm:2’ shape=(32,) dtype=float32>, <tf.Tensor ‘conv2_3/1/conv2_3/1/bn/FusedBatchNorm:3’ shape=(32,) dtype=float32>, <tf.Tensor ‘conv2_3/1/conv2_3/1/bn/FusedBatchNorm:4’ shape=(32,) dtype=float32>)
(<tf.Tensor ‘conv2_3/1/Elu:0’ shape=(?, 63, 31, 32) dtype=float32>,)
(<tf.Tensor ‘Dropout_1/Identity:0’ shape=(?, 63, 31, 32) dtype=float32>,)
(<tf.Tensor ‘conv2_3/2/weights:0’ shape=(3, 3, 32, 32) dtype=float32>,)
(<tf.Tensor ‘conv2_3/2/weights/read:0’ shape=(3, 3, 32, 32) dtype=float32>,)
(<tf.Tensor ‘conv2_3/2/biases:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_3/2/biases/read:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv2_3/2/Conv2D:0’ shape=(?, 63, 31, 32) dtype=float32>,)
(<tf.Tensor ‘conv2_3/2/BiasAdd:0’ shape=(?, 63, 31, 32) dtype=float32>,)
(<tf.Tensor ‘add_1:0’ shape=(?, 63, 31, 32) dtype=float32>,)
(<tf.Tensor ‘conv3_1/bn/Const:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv3_1/bn/beta:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv3_1/bn/beta/read:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv3_1/bn/moving_mean:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv3_1/bn/moving_mean/read:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv3_1/bn/moving_variance:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv3_1/bn/moving_variance/read:0’ shape=(32,) dtype=float32>,)
(<tf.Tensor ‘conv3_1/bn/FusedBatchNorm:0’ shape=(?, 63, 31, 32) dtype=float32>, <tf.Tensor ‘conv3_1/bn/FusedBatchNorm:1’ shape=(32,) dtype=float32>, <tf.Tensor ‘conv3_1/bn/FusedBatchNorm:2’ shape=(32,) dtype=float32>, <tf.Tensor ‘conv3_1/bn/FusedBatchNorm:3’ shape=(32,) dtype=float32>, <tf.Tensor ‘conv3_1/bn/FusedBatchNorm:4’ shape=(32,) dtype=float32>)
(<tf.Tensor ‘Elu_1:0’ shape=(?, 63, 31, 32) dtype=float32>,)
(<tf.Tensor ‘conv3_1/1/weights:0’ shape=(3, 3, 32, 64) dtype=float32>,)
(<tf.Tensor ‘conv3_1/1/weights/read:0’ shape=(3, 3, 32, 64) dtype=float32>,)
(<tf.Tensor ‘conv3_1/1/Conv2D:0’ shape=(?, 32, 16, 64) dtype=float32>,)
(<tf.Tensor ‘conv3_1/1/conv3_1/1/bn/Const:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_1/1/conv3_1/1/bn/beta:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_1/1/conv3_1/1/bn/beta/read:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_1/1/conv3_1/1/bn/moving_mean:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_1/1/conv3_1/1/bn/moving_mean/read:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_1/1/conv3_1/1/bn/moving_variance:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_1/1/conv3_1/1/bn/moving_variance/read:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_1/1/conv3_1/1/bn/FusedBatchNorm:0’ shape=(?, 32, 16, 64) dtype=float32>, <tf.Tensor ‘conv3_1/1/conv3_1/1/bn/FusedBatchNorm:1’ shape=(64,) dtype=float32>, <tf.Tensor ‘conv3_1/1/conv3_1/1/bn/FusedBatchNorm:2’ shape=(64,) dtype=float32>, <tf.Tensor ‘conv3_1/1/conv3_1/1/bn/FusedBatchNorm:3’ shape=(64,) dtype=float32>, <tf.Tensor ‘conv3_1/1/conv3_1/1/bn/FusedBatchNorm:4’ shape=(64,) dtype=float32>)
(<tf.Tensor ‘conv3_1/1/Elu:0’ shape=(?, 32, 16, 64) dtype=float32>,)
(<tf.Tensor ‘Dropout_2/Identity:0’ shape=(?, 32, 16, 64) dtype=float32>,)
(<tf.Tensor ‘conv3_1/2/weights:0’ shape=(3, 3, 64, 64) dtype=float32>,)
(<tf.Tensor ‘conv3_1/2/weights/read:0’ shape=(3, 3, 64, 64) dtype=float32>,)
(<tf.Tensor ‘conv3_1/2/biases:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_1/2/biases/read:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_1/2/Conv2D:0’ shape=(?, 32, 16, 64) dtype=float32>,)
(<tf.Tensor ‘conv3_1/2/BiasAdd:0’ shape=(?, 32, 16, 64) dtype=float32>,)
(<tf.Tensor ‘conv3_1/projection/weights:0’ shape=(1, 1, 32, 64) dtype=float32>,)
(<tf.Tensor ‘conv3_1/projection/weights/read:0’ shape=(1, 1, 32, 64) dtype=float32>,)
(<tf.Tensor ‘conv3_1/projection/Conv2D:0’ shape=(?, 32, 16, 64) dtype=float32>,)
(<tf.Tensor ‘add_2:0’ shape=(?, 32, 16, 64) dtype=float32>,)
(<tf.Tensor ‘conv3_3/bn/Const:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_3/bn/beta:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_3/bn/beta/read:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_3/bn/moving_mean:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_3/bn/moving_mean/read:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_3/bn/moving_variance:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_3/bn/moving_variance/read:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_3/bn/FusedBatchNorm:0’ shape=(?, 32, 16, 64) dtype=float32>, <tf.Tensor ‘conv3_3/bn/FusedBatchNorm:1’ shape=(64,) dtype=float32>, <tf.Tensor ‘conv3_3/bn/FusedBatchNorm:2’ shape=(64,) dtype=float32>, <tf.Tensor ‘conv3_3/bn/FusedBatchNorm:3’ shape=(64,) dtype=float32>, <tf.Tensor ‘conv3_3/bn/FusedBatchNorm:4’ shape=(64,) dtype=float32>)
(<tf.Tensor ‘Elu_2:0’ shape=(?, 32, 16, 64) dtype=float32>,)
(<tf.Tensor ‘conv3_3/1/weights:0’ shape=(3, 3, 64, 64) dtype=float32>,)
(<tf.Tensor ‘conv3_3/1/weights/read:0’ shape=(3, 3, 64, 64) dtype=float32>,)
(<tf.Tensor ‘conv3_3/1/Conv2D:0’ shape=(?, 32, 16, 64) dtype=float32>,)
(<tf.Tensor ‘conv3_3/1/conv3_3/1/bn/Const:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_3/1/conv3_3/1/bn/beta:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_3/1/conv3_3/1/bn/beta/read:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_3/1/conv3_3/1/bn/moving_mean:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_3/1/conv3_3/1/bn/moving_mean/read:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_3/1/conv3_3/1/bn/moving_variance:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_3/1/conv3_3/1/bn/moving_variance/read:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_3/1/conv3_3/1/bn/FusedBatchNorm:0’ shape=(?, 32, 16, 64) dtype=float32>, <tf.Tensor ‘conv3_3/1/conv3_3/1/bn/FusedBatchNorm:1’ shape=(64,) dtype=float32>, <tf.Tensor ‘conv3_3/1/conv3_3/1/bn/FusedBatchNorm:2’ shape=(64,) dtype=float32>, <tf.Tensor ‘conv3_3/1/conv3_3/1/bn/FusedBatchNorm:3’ shape=(64,) dtype=float32>, <tf.Tensor ‘conv3_3/1/conv3_3/1/bn/FusedBatchNorm:4’ shape=(64,) dtype=float32>)
(<tf.Tensor ‘conv3_3/1/Elu:0’ shape=(?, 32, 16, 64) dtype=float32>,)
(<tf.Tensor ‘Dropout_3/Identity:0’ shape=(?, 32, 16, 64) dtype=float32>,)
(<tf.Tensor ‘conv3_3/2/weights:0’ shape=(3, 3, 64, 64) dtype=float32>,)
(<tf.Tensor ‘conv3_3/2/weights/read:0’ shape=(3, 3, 64, 64) dtype=float32>,)
(<tf.Tensor ‘conv3_3/2/biases:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_3/2/biases/read:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv3_3/2/Conv2D:0’ shape=(?, 32, 16, 64) dtype=float32>,)
(<tf.Tensor ‘conv3_3/2/BiasAdd:0’ shape=(?, 32, 16, 64) dtype=float32>,)
(<tf.Tensor ‘add_3:0’ shape=(?, 32, 16, 64) dtype=float32>,)
(<tf.Tensor ‘conv4_1/bn/Const:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv4_1/bn/beta:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv4_1/bn/beta/read:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv4_1/bn/moving_mean:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv4_1/bn/moving_mean/read:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv4_1/bn/moving_variance:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv4_1/bn/moving_variance/read:0’ shape=(64,) dtype=float32>,)
(<tf.Tensor ‘conv4_1/bn/FusedBatchNorm:0’ shape=(?, 32, 16, 64) dtype=float32>, <tf.Tensor ‘conv4_1/bn/FusedBatchNorm:1’ shape=(64,) dtype=float32>, <tf.Tensor ‘conv4_1/bn/FusedBatchNorm:2’ shape=(64,) dtype=float32>, <tf.Tensor ‘conv4_1/bn/FusedBatchNorm:3’ shape=(64,) dtype=float32>, <tf.Tensor ‘conv4_1/bn/FusedBatchNorm:4’ shape=(64,) dtype=float32>)
(<tf.Tensor ‘Elu_3:0’ shape=(?, 32, 16, 64) dtype=float32>,)
(<tf.Tensor ‘conv4_1/1/weights:0’ shape=(3, 3, 64, 128) dtype=float32>,)
(<tf.Tensor ‘conv4_1/1/weights/read:0’ shape=(3, 3, 64, 128) dtype=float32>,)
(<tf.Tensor ‘conv4_1/1/Conv2D:0’ shape=(?, 16, 8, 128) dtype=float32>,)
(<tf.Tensor ‘conv4_1/1/conv4_1/1/bn/Const:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_1/1/conv4_1/1/bn/beta:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_1/1/conv4_1/1/bn/beta/read:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_1/1/conv4_1/1/bn/moving_mean:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_1/1/conv4_1/1/bn/moving_mean/read:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_1/1/conv4_1/1/bn/moving_variance:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_1/1/conv4_1/1/bn/moving_variance/read:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_1/1/conv4_1/1/bn/FusedBatchNorm:0’ shape=(?, 16, 8, 128) dtype=float32>, <tf.Tensor ‘conv4_1/1/conv4_1/1/bn/FusedBatchNorm:1’ shape=(128,) dtype=float32>, <tf.Tensor ‘conv4_1/1/conv4_1/1/bn/FusedBatchNorm:2’ shape=(128,) dtype=float32>, <tf.Tensor ‘conv4_1/1/conv4_1/1/bn/FusedBatchNorm:3’ shape=(128,) dtype=float32>, <tf.Tensor ‘conv4_1/1/conv4_1/1/bn/FusedBatchNorm:4’ shape=(128,) dtype=float32>)
(<tf.Tensor ‘conv4_1/1/Elu:0’ shape=(?, 16, 8, 128) dtype=float32>,)
(<tf.Tensor ‘Dropout_4/Identity:0’ shape=(?, 16, 8, 128) dtype=float32>,)
(<tf.Tensor ‘conv4_1/2/weights:0’ shape=(3, 3, 128, 128) dtype=float32>,)
(<tf.Tensor ‘conv4_1/2/weights/read:0’ shape=(3, 3, 128, 128) dtype=float32>,)
(<tf.Tensor ‘conv4_1/2/biases:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_1/2/biases/read:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_1/2/Conv2D:0’ shape=(?, 16, 8, 128) dtype=float32>,)
(<tf.Tensor ‘conv4_1/2/BiasAdd:0’ shape=(?, 16, 8, 128) dtype=float32>,)
(<tf.Tensor ‘conv4_1/projection/weights:0’ shape=(1, 1, 64, 128) dtype=float32>,)
(<tf.Tensor ‘conv4_1/projection/weights/read:0’ shape=(1, 1, 64, 128) dtype=float32>,)
(<tf.Tensor ‘conv4_1/projection/Conv2D:0’ shape=(?, 16, 8, 128) dtype=float32>,)
(<tf.Tensor ‘add_4:0’ shape=(?, 16, 8, 128) dtype=float32>,)
(<tf.Tensor ‘conv4_3/bn/Const:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_3/bn/beta:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_3/bn/beta/read:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_3/bn/moving_mean:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_3/bn/moving_mean/read:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_3/bn/moving_variance:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_3/bn/moving_variance/read:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_3/bn/FusedBatchNorm:0’ shape=(?, 16, 8, 128) dtype=float32>, <tf.Tensor ‘conv4_3/bn/FusedBatchNorm:1’ shape=(128,) dtype=float32>, <tf.Tensor ‘conv4_3/bn/FusedBatchNorm:2’ shape=(128,) dtype=float32>, <tf.Tensor ‘conv4_3/bn/FusedBatchNorm:3’ shape=(128,) dtype=float32>, <tf.Tensor ‘conv4_3/bn/FusedBatchNorm:4’ shape=(128,) dtype=float32>)
(<tf.Tensor ‘Elu_4:0’ shape=(?, 16, 8, 128) dtype=float32>,)
(<tf.Tensor ‘conv4_3/1/weights:0’ shape=(3, 3, 128, 128) dtype=float32>,)
(<tf.Tensor ‘conv4_3/1/weights/read:0’ shape=(3, 3, 128, 128) dtype=float32>,)
(<tf.Tensor ‘conv4_3/1/Conv2D:0’ shape=(?, 16, 8, 128) dtype=float32>,)
(<tf.Tensor ‘conv4_3/1/conv4_3/1/bn/Const:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_3/1/conv4_3/1/bn/beta:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_3/1/conv4_3/1/bn/beta/read:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_3/1/conv4_3/1/bn/moving_mean:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_3/1/conv4_3/1/bn/moving_mean/read:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_3/1/conv4_3/1/bn/moving_variance:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_3/1/conv4_3/1/bn/moving_variance/read:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_3/1/conv4_3/1/bn/FusedBatchNorm:0’ shape=(?, 16, 8, 128) dtype=float32>, <tf.Tensor ‘conv4_3/1/conv4_3/1/bn/FusedBatchNorm:1’ shape=(128,) dtype=float32>, <tf.Tensor ‘conv4_3/1/conv4_3/1/bn/FusedBatchNorm:2’ shape=(128,) dtype=float32>, <tf.Tensor ‘conv4_3/1/conv4_3/1/bn/FusedBatchNorm:3’ shape=(128,) dtype=float32>, <tf.Tensor ‘conv4_3/1/conv4_3/1/bn/FusedBatchNorm:4’ shape=(128,) dtype=float32>)
(<tf.Tensor ‘conv4_3/1/Elu:0’ shape=(?, 16, 8, 128) dtype=float32>,)
(<tf.Tensor ‘Dropout_5/Identity:0’ shape=(?, 16, 8, 128) dtype=float32>,)
(<tf.Tensor ‘conv4_3/2/weights:0’ shape=(3, 3, 128, 128) dtype=float32>,)
(<tf.Tensor ‘conv4_3/2/weights/read:0’ shape=(3, 3, 128, 128) dtype=float32>,)
(<tf.Tensor ‘conv4_3/2/biases:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_3/2/biases/read:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘conv4_3/2/Conv2D:0’ shape=(?, 16, 8, 128) dtype=float32>,)
(<tf.Tensor ‘conv4_3/2/BiasAdd:0’ shape=(?, 16, 8, 128) dtype=float32>,)
(<tf.Tensor ‘add_5:0’ shape=(?, 16, 8, 128) dtype=float32>,)
(<tf.Tensor ‘Flatten/flatten/Shape:0’ shape=(4,) dtype=int32>,)
(<tf.Tensor ‘Flatten/flatten/strided_slice/stack:0’ shape=(1,) dtype=int32>,)
(<tf.Tensor ‘Flatten/flatten/strided_slice/stack_1:0’ shape=(1,) dtype=int32>,)
(<tf.Tensor ‘Flatten/flatten/strided_slice/stack_2:0’ shape=(1,) dtype=int32>,)
(<tf.Tensor ‘Flatten/flatten/strided_slice:0’ shape=() dtype=int32>,)
(<tf.Tensor ‘Flatten/flatten/Reshape/shape/1:0’ shape=() dtype=int32>,)
(<tf.Tensor ‘Flatten/flatten/Reshape/shape:0’ shape=(2,) dtype=int32>,)
(<tf.Tensor ‘Flatten/flatten/Reshape:0’ shape=(?, ?) dtype=float32>,)
(<tf.Tensor ‘Dropout_6/Identity:0’ shape=(?, ?) dtype=float32>,)
(<tf.Tensor ‘fc1/weights:0’ shape=(16384, 128) dtype=float32>,)
(<tf.Tensor ‘fc1/weights/read:0’ shape=(16384, 128) dtype=float32>,)
(<tf.Tensor ‘fc1/MatMul:0’ shape=(?, 128) dtype=float32>,)
(<tf.Tensor ‘fc1/fc1/bn/Reshape/shape:0’ shape=(4,) dtype=int32>,)
(<tf.Tensor ‘fc1/fc1/bn/Reshape:0’ shape=(?, 1, 1, 128) dtype=float32>,)
(<tf.Tensor ‘fc1/fc1/bn/beta:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘fc1/fc1/bn/beta/read:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘fc1/fc1/bn/Const:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘fc1/fc1/bn/moving_mean:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘fc1/fc1/bn/moving_mean/read:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘fc1/fc1/bn/moving_variance:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘fc1/fc1/bn/moving_variance/read:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘fc1/fc1/bn/FusedBatchNorm:0’ shape=(?, 1, 1, 128) dtype=float32>, <tf.Tensor ‘fc1/fc1/bn/FusedBatchNorm:1’ shape=(128,) dtype=float32>, <tf.Tensor ‘fc1/fc1/bn/FusedBatchNorm:2’ shape=(128,) dtype=float32>, <tf.Tensor ‘fc1/fc1/bn/FusedBatchNorm:3’ shape=(128,) dtype=float32>, <tf.Tensor ‘fc1/fc1/bn/FusedBatchNorm:4’ shape=(128,) dtype=float32>)
(<tf.Tensor ‘fc1/fc1/bn/Shape:0’ shape=(2,) dtype=int32>,)
(<tf.Tensor ‘fc1/fc1/bn/Reshape_1:0’ shape=(?, 128) dtype=float32>,)
(<tf.Tensor ‘fc1/Elu:0’ shape=(?, 128) dtype=float32>,)
(<tf.Tensor ‘ball/Reshape/shape:0’ shape=(4,) dtype=int32>,)
(<tf.Tensor ‘ball/Reshape:0’ shape=(?, 1, 1, 128) dtype=float32>,)
(<tf.Tensor ‘ball/beta:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘ball/beta/read:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘ball/Const:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘ball/moving_mean:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘ball/moving_mean/read:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘ball/moving_variance:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘ball/moving_variance/read:0’ shape=(128,) dtype=float32>,)
(<tf.Tensor ‘ball/FusedBatchNorm:0’ shape=(?, 1, 1, 128) dtype=float32>, <tf.Tensor ‘ball/FusedBatchNorm:1’ shape=(128,) dtype=float32>, <tf.Tensor ‘ball/FusedBatchNorm:2’ shape=(128,) dtype=float32>, <tf.Tensor ‘ball/FusedBatchNorm:3’ shape=(128,) dtype=float32>, <tf.Tensor ‘ball/FusedBatchNorm:4’ shape=(128,) dtype=float32>)
(<tf.Tensor ‘ball/Shape:0’ shape=(2,) dtype=int32>,)
(<tf.Tensor ‘ball/Reshape_1:0’ shape=(?, 128) dtype=float32>,)
(<tf.Tensor ‘Const:0’ shape=() dtype=float32>,)
(<tf.Tensor ‘Square:0’ shape=(?, 128) dtype=float32>,)
(<tf.Tensor ‘Sum/reduction_indices:0’ shape=(1,) dtype=int32>,)
(<tf.Tensor ‘Sum:0’ shape=(?, 1) dtype=float32>,)
(<tf.Tensor ‘add_6:0’ shape=(?, 1) dtype=float32>,)
(<tf.Tensor ‘Sqrt:0’ shape=(?, 1) dtype=float32>,)
(<tf.Tensor ‘truediv:0’ shape=(?, 128) dtype=float32>,)
(<tf.Tensor ‘features:0’ shape=(?, 128) dtype=float32>,)

In my case I think input node is images and out_put node is features

in my graph also present these nodes

" ‘num_detections’, ‘detection_boxes’, ‘detection_scores’,\n",
" ‘detection_classes’, ‘detection_masks’\n",
but I try all these nodes name not work for me genrate the same error
AssertionError Traceback (most recent call last)
in ()
9
10 # freeze graph and remove training nodes
—> 11 graph_def = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, output_names)
12 graph_def = tf.graph_util.remove_training_nodes(graph_def)
13

/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/graph_util_impl.py in convert_variables_to_constants(sess, input_graph_def, output_node_names, variable_names_whitelist, variable_names_blacklist)
230 # This graph only includes the nodes needed to evaluate the output nodes, and
231 # removes unneeded nodes like those involved in saving and assignment.
→ 232 inference_graph = extract_sub_graph(input_graph_def, output_node_names)
233
234 found_variables = {}

/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/graph_util_impl.py in extract_sub_graph(graph_def, dest_nodes)
172 name_to_input_name, name_to_node, name_to_seq_num = _extract_graph_summary(
173 graph_def)
→ 174 _assert_nodes_are_present(name_to_node, dest_nodes)
175
176 nodes_to_keep = _bfs_for_reachable_nodes(dest_nodes, name_to_input_name)

/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/graph_util_impl.py in _assert_nodes_are_present(name_to_node, nodes)
131 “”“Assert that nodes are present in the graph.”“”
132 for d in nodes:
→ 133 assert d in name_to_node, “%s is not in graph” % d
134
135

AssertionError: detection_classes is not in graph
you can see my frozen graph using tensorboard

And the file from which I created frozen graph file

Thanks

Hi,

Here is a tutorial of TF->TRT for the object detection use case:

It should give you some hint.

Thanks.

Thanks @AastaLLL I think this function doesn’t work on tensorRt 4.0.16(am I right?)

Given function

import tensorflow.contrib.tensorrt as trt

trt_graph = trt.create_inference_graph(
input_graph_def=frozen_graph,
outputs=output_names,
max_batch_size=1,
max_workspace_size_bytes=1 << 25,
precision_mode=‘FP16’,
minimum_segment_size=50
)

Hi p146103,

The TensorRT package may work for the models listed (even with TensorRT 4). If you run into an error related to that repository, could you please open an issue with the error log under

[url]https://github.com/NVIDIA-Jetson/tf_trt_models[/url]

Thanks!
John

Hi,

I am trying to convert a tensorflow .pb file to uff file using uff and it failed.

This is on TensorRT 4.1 with cuda 8.0.

import tensorflow as tf
import uff

if name == “main”:
uff.from_tensorflow(graphdef=“/home/Work/Tensorrt/Model/ssd_inception_v2_coco_2018_01_28/frozen_inference_graph.pb”,
output_filename=“ssd.uff”,
output_nodes=[‘detection_scores’,‘detection_boxes’, ‘detection_classes’, ‘num_detections’])

output:

import pandas.parser as _parser
Using output node detection_scores
Using output node detection_boxes
Using output node detection_classes
Using output node num_detections
Converting to UFF graph
Traceback (most recent call last):
File “convert.py”, line 7, in
output_nodes=[‘detection_scores’,‘detection_boxes’, ‘detection_classes’, ‘num_detections’])
File “/usr/lib/python2.7/dist-packages/uff/converters/tensorflow/conversion_helpers.py”, line 120, in from_tensorflow
name=“main”)
File “/usr/lib/python2.7/dist-packages/uff/converters/tensorflow/converter.py”, line 77, in convert_tf2uff_graph
uff_graph, input_replacements)
File “/usr/lib/python2.7/dist-packages/uff/converters/tensorflow/converter.py”, line 54, in convert_tf2uff_node
raise UffException(str(name) + " was not found in the graph. Please use the -l option to list nodes in the graph.")
uff.model.exceptions.UffException: num_detections was not found in the graph. Please use the -l option to list nodes in the graph.

I am pretty sure that output node is right. Please help

Hi,

The log indicates there is no ‘num_detections’ layer inside your model.
Maybe you can check if there is any prefix name on it.

Thanks.