so, I am trying this. I am trying to load the simplest object detection module from the tf zoo, http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_coco_2018_01_28.tar.gz
following the doc, I have successfully converted the frozen graph to UFF, so far so good althoug i got heaps of messages about non implemented ops that are going to bite me later, I am sure.
still following the doc, I tried importing the graph using the code:
with builder = trt.Builder(TRT_LOGGER) as builder, builder.create_network() as network, trt.UffParser() as parser:
parser.register_input("Placeholder", (1, 28, 28))
parser.register_output("fc2/Relu")
parser.parse(model_file, network)
which is, just saying, a syntax error (“builder =” inside a with is not proper syntax), but lets ignore that for a moment.
so my code looks like:
import tensorrt as trt
import time
TRT_LOGGER = trt.Logger(trt.Logger.WARNING)
model_file = 'frozen_inference_graph.uff'
print("#1", time.time())
with trt.Builder(TRT_LOGGER) as builder, builder.create_network() as network, trt.UffParser() as parser:
print("#2", time.time())
parser.register_input("Placeholder", (1, 28, 28))
print("#3", time.time())
parser.register_output("fc2/Relu")
print("#4", time.time())
parser.parse(model_file, network)
print("#5", time.time())
it fails with:
[TensorRT] ERROR: UFFParser: Graph error: Cycle graph detected