AttributeError: 'str' object has no attribute 'SerializeToString'

Traceback (most recent call last):
File “”, line 87, in
File “/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/tensorrt/python/”, line 131, in create_inference_graph
input_graph_def_str = input_graph_def.SerializeToString()
AttributeError: ‘str’ object has no attribute ‘SerializeToString’

Hello p146103,

Thank you for posting on TensorRT Forum. In order for the community to effectively help you, please describe the issue you are seeing.

What is your platform/GPU? What is the usage scenario? What commands are you executing when you see the error? Any usage/source file you can provide will help us debug too.

NVIDIA Enterprise Support

I have Frozen graph file I want to convert Frozen graph to trt_graph(Tensorrt graph) to speed up my model.
I want to use this trt_graph for object detection Problem

code link:

Frozen Grpah file:

You can suggest me an other code for frozen_graph to tensor_rt grpah

Platform and pakages

Gpu:GTX 1080


this seems to be TF specific issue.

def get_frozen_graph(graph_file):
  """Read Frozen Graph file from disk."""
  with tf.gfile.FastGFile(graph_file, "rb") as f:
    graph_def = tf.GraphDef()
[b]    graph_def.ParseFromString(
[/b]  return graph_def

Can you try TF 1.9 and see if this goes away?