I get almost identical error if instead of cmd I run using Anaconda prompt with Python 3.7.3 “No module named 'tensorflow.python.compiler.”
Also confirmed that import tensorflow DOES work in a Python shell.
So bottom line is that the tensorRT module is missing. Then how to install? A quick google shows no Windows installer or support? I already tried uninstalling then reinstalling tensorflow and tensorflow-gpu
Update Your Code: If you’re using TensorFlow 2.x, update your code to use the latest TensorFlow APIs. Many functionalities from tensorflow.contrib have been integrated into the core TensorFlow library or are available as separate packages.
Use TensorFlow 1.x: If you need to run legacy code that relies on tensorflow.contrib, you can install an older version of TensorFlow (1.15 is the last version that included contrib). You can do this with pip:
bashCopy code
pip install tensorflow==1.15
However, be aware that TensorFlow 1.x is no longer actively maintained.
Check for Alternative Libraries: For some specific modules in tensorflow.contrib, alternative standalone libraries are available. For example, tf.contrib.slim has some parallels with tf_slim, and tf.contrib.rnn functionalities are mostly available in core TensorFlow.