Tensorflow.compat not found - tensorflow

I am trying
import tensorflow.compat.v1 as tf
and getting an error
ModuleNotFoundError: No module named 'tensorflow.compat'.
I've installed tensorflow=2.8.0, tensorflow-estimator=2.1, tensorflow-gpu=2.8.0 and the python version is 3.9.9. What could be the issue?

Related

No module named 'tensorflow.contrib' even on tensorflow 1.13.2

I cant import a gpt_2_simple package due to an error
ModuleNotFoundError: No module named 'tensorflow.contrib'
I have installed python 3.7 and tried to install tensorflow 1.15.5, 1.15.2 and 1.13.2 and all of them were gaining this mistake. Im using windows.
Works with python 3.6 and tensorflow 1.15.2

Using tflearn, getting ModuleNotFoundError: No module named 'tensorflow.contrib'

I'm working with tensorflow==2.2.0rc1 and tflearn==0.3.2 and I keep getting the same error when importing:
ModuleNotFoundError: No module named 'tensorflow.contrib'
Although I import the packages:
import tflearn
import tensorflow
From TFLearn's documentation and your error, it's probably only compatible with Tensorflow < 2, so reinstall tensorflow of version 1.x.
tensorflow.contrib was deprecated in Tensorflow 2.

Importing the multiarray numpy extension module failed, installed numpy using pip

I try to run a project from GitHUB that demands python3.5 and numpy installed.
I've installed numpy with pip3.5 install numpy and got the following error:
raise ImportError(msg) ImportError:
Importing the multiarray numpy extension module failed.
Otherwise reinstall numpy.
The original error was:
cannot import name multiarray
I've tried to reinstall numpy and so I did, but this didn't solve the problem.
The environment is
ubuntu 16.4,
python 3.5,
numpy version installed: 1.15.1
How can I solve this error?

How to solve ImportError even Rasa_nlu and tensorflow are installed successfully

I faced the following error after installing Rasa_nlu and Tensorflow.
ImportError: Failed to import `tensorflow`. Please install `tensorflow`. For example with `pip install tensorflow`.
Before getting the above error message, I have successfully import the following packages as shown below.
from rasa_nlu.training_data import load_data
from rasa_nlu.config import RasaNLUModelConfig
from rasa_nlu.model import Trainer
from rasa_nlu import config
import tensorflow as tf
The following is the version of Anaconda3, Tensorflow, Rasa_nlu and python.
Anaconda-client: 1.6.14,
Anaconda-navigator: 1.8.7,
Anaconda-project: 0.8.2,
Python: 3.6,
Tensorflow: 1.8.0,
Could someone help me about me? Thank you so much.

Unable to import distributions module from Tensorflow (Dockerized)

I'm running the official TF docker repo using the Jupyter UI on localhost. It seems that TF is working in general, as I am able to import it, but when trying to import the distributions module I get an error:
print tf.__version__
import tf.distributions as dist
1.8.0
ImportErrorTraceback (most recent call last)
<ipython-input-3-4d440943cb46> in <module>()
1 print tf.__version__
----> 2 import tf.distributions as dist
ImportError: No module named tf.distributions
Try this
import tensorflow as tf
from tensorflow import distributions as dist
I don't think you can use import aliases for other import statements in python. I'm not too sure about this, but I think that's the problem.
FYI, I tested this on Python 3.5.2 and Tensorflow 1.8.0