Hello
I have a problem with TensorRT and its implementation in TensorFlow.
My code is:
import tensorflow as tf
import tensorrt
import pycuda.driver as cuda
import pycuda.autoinit
import numpy as np
from PIL import Image
import time
import os
import uff
OUTPUT_NAMES = ['DepthToSpace']
export_dir = "/data/Xiph_defs_collection_4K_Preview_19EA/pb/11909700/"
with tf.Session(graph=tf.Graph()) as sess:
tf.saved_model.loader.load(sess, [tf.saved_model.tag_constants.GPU], export_dir)
graphdef = tf.get_default_graph().as_graph_def()
frozen_graph = tf.graph_util.convert_variables_to_constants(sess,
graphdef,
OUTPUT_NAMES)
tf_model = tf.graph_util.remove_training_nodes(frozen_graph)
uff_model = uff.from_tensorflow(tf_model, OUTPUT_NAMES)
G_LOGGER = trt.infer.ConsoleLogger(trt.infer.LogSeverity.ERROR)
Error is:
AttributeError Traceback (most recent call last)
<ipython-input-14-69202d011f11> in <module>()
----> 1 G_LOGGER = trt.infer.ConsoleLogger(trt.infer.LogSeverity.ERROR)
AttributeError: 'module' object has no attribute 'infer'
I’m following this tutorial
https://github.com/Microsoft/MMdnn/wiki/Using-TensorRT-to-Accelerate-Inference
My environment
Ubuntu 16.04
TF r1.12 (built from source)
TensorRT 5.0.2.6
Python 2.7
CUDA V10.0.130
cuDNN 7.4.1
NVIDIA GPU - GTX1080 TI