profile
viewpoint

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!

tensorflow/tensorflow

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

https://github.com/tensorflow/tensorrt/blob/master/tftrt/examples/image-classification/image_classification.py#L22 "

from StackOverflow

useful!

Related questions

ModuleNotFoundError: No module named 'tensorflow.contrib' hot 8
Error occurred when finalizing GeneratorDataset iterator
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
When importing TensorFlow, error loading Hadoop hot 4
tensorflow2.0 detected 'xla_gpu' , but 'gpu' expected hot 3
The flag 'log_dir' is defined twice. hot 3
[TF 2.0] Dataset has no attribute 'make_one_shot_iterator' hot 3
[TF 2.0] tf.keras.optimizers.Adam hot 3
ImportError: No module named 'tensorflow.tools' hot 3
Tensorflow 2.0 error when used via pyinstaller build - ImportError: cannot import name 'pywrap_tensorflow' from 'tensorflow_core.python' hot 3
Tf.Keras metrics issue hot 3
Error loading tensorflow hot 3
AttributeError: module 'tensorflow' has no attribute 'set_random_seed' hot 3
AttributeError: module 'tensorflow' has no attribute 'Session' hot 3
Github User Rank List