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

Traceback (most recent call last):
File “demo.py”, line 87, in
minimum_segment_size=3)
File “/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/tensorrt/python/trt_convert.py”, 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.

regards,
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:Optimize frozen tensorflow graph using TensorRT · GitHub

Frozen Grpah file:mars-small128.pb - Google Drive

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

Platform and pakages

Linux:16.04
Gpu:GTX 1080
TensorRt:4.0.1.6
Tensorflow:1.10
Python:3.5
Cuda:9.0

Hello,

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(f.read())
[/b]  return graph_def

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