Ask questions ModuleNotFoundError: No module named 'tensorflow.contrib'

Have spent a couple days troubleshooting. Am getting the following error

ModuleNotFoundError: No module named 'tensorflow.contrib'

The offending line is

import tensorflow.contrib.tensorrt as trt

Here are my setup specs

Windows 10

Python 3.6.8

CUDA 10.0

cuDNN v 7.6.2

Tensorflow (gpu) 1.14.0

GeForce GTX 960M

Driver version 431.60

Intel Core i7-6700HQ 2.6 GHz*

Any feedback or troubleshooting steps appreciated!


Answer questions KabirKwatra

"In TF 1.14, TF-TRT was moved to the core from contrib.

You need to import it like this: from tensorflow.python.compiler.tensorrt import trt_convert as trt "

from StackOverflow


Related questions

ModuleNotFoundError: No module named 'tensorflow.contrib' hot 8
Error occurred when finalizing GeneratorDataset iterator hot 7
tensorflow-gpu CUPTI errors
Error loading tensorflow
module 'tensorflow' has no attribute 'ConfigProto'
TF 2.0 'Tensor' object has no attribute 'numpy' while using .numpy() although eager execution enabled by default
When importing TensorFlow, error loading Hadoop
AttributeError: module 'tensorflow.python.framework.op_def_registry' has no attribute 'register_op_list'
tf.keras.layers.Conv1DTranspose ?
[TF 2.0] tf.keras.optimizers.Adam hot 4
Lossy conversion from float32 to uint8. Range [0, 1]. Convert image to uint8 prior to saving to suppress this warning. hot 4
TF2.0 AutoGraph issue hot 4
Tf.Keras metrics issue hot 4
ModuleNotFoundError: No module named 'tensorflow.examples.tutorials' hot 4
module 'tensorflow.python._pywrap_tensorflow_internal' has no attribute 'TFE_NewContextOptions' hot 4
Github User Rank List