Facing this while working with jupyter notebook
Tensorflow and keras version -- 2.8.0
Please help me with this tried installing the previous version of keras and reinstalling as well but it didn't work.
Related
I have just upgraded tensorflow to the 2.11.0 version but I am having issues while importing packages.
In particular, while importing the 'compat' and the 'keras' modules I got the following errors:
import tensorflow.compat.v2 as tf
ModuleNotFoundError: No module named 'tensorflow.compat'
from tensorflow import keras
ImportError: cannot import name 'keras' from 'tensorflow' (unknown location)
What can be the reason of these import errors? I never had them before but I had to upgrade to the 2.11.0
I have tryied to unistall and re-install but I always get the same issue.
I need the 2.11.0 since otherwise I have issues with the 'build' method for optimizers in the tf.keras.optimizers module
i'm trying to import tensorflow-hub and i'm getting an error:
ModuleNotFoundError: No module named 'tensorflow.python.checkpoint'
full error message
Apparently the folder tensorflow.python.checkpoint doesn't exist in the tensorflow source code that I installed (though it does exist in the github repository of tensorflow)
I'm using
tensorflow 2.9.1
tensorflow-estimator 2.9.0
tensorflow-hub 0.8.0
Thanks!
it's probably not a permanent solution, but I think downgrading TensforFlow to version 1.15 should help
this is the code. im executing this using spyder. and tried many versions of tensorflow but unable to solve this
this is the error im getting. before i was gettng import error cannot import 'load_img'
I had a similar problem. I had tensorflow 2.6.0 installed but tensorflow-estimator 2.10.0. The problem was solved by downgrading tensorflow-estimator:
pip install --upgrade tensorflow-estimator==2.6.0
Download tensorflow before running your code.
pip install tensorflow
I installed RetinaFace and TensorFlow for my project and when I run, this error appear. for RetinaFace I should use TensorFlow with 2.1.0 version and for this I cant upgrade or downgrade it.
I reinstall and install TensorFlow for several time but it doesn't fix my issue.
python: 3.6.0
TensorFlow: 2.1.0
RetinaFace: 0.0.6
on windows
ModuleNotFoundError: No module named 'tensorflow.python.tools'; 'tensorflow.python' is not a package
this version of TensorFlow is available from python3.7 up
I'm using python 3.8.2 , keras 2.3.1 and tensorflow 2.2.0rc4 .
just with the following code :
import keras
from keras.models import sequential
I have this error :
AttributeError: partially initialized module 'keras.backend' has no attribute 'eager' (most likely due to a circular import)
if I use :
import tensorflow
or
from tensorflow.keras import ....
new error :
AttributeError: partially initialized module 'tensorflow.python.framework.ops' has no attribute 'register_tensor_conversion_function' (most likely due to a circular import)
full traceback:
enter image description here
enter image description here
My suggestion is to reinstall the package. Sometimes this happens due to the installation problem.
Use the following code to do so
Uninstall tensorflow
pip uninstall tensorflow
Requires the latest pip
pip install --upgrade pip
To install keras as separate package
pip install Keras
Current stable release for CPU and GPU
pip install tensorflow
Try this and hope this helps you.
It's an install problem, most likely; K.eager was introduced in Keras 2.3.0 (and is included in Keras 2.3.1), so your Python interpreter is somehow reading code of 2.2.5 or earlier.
A possible culprit is an Anaconda mishap. First run conda uninstall keras. Then, in the anaconda3 directory, search "keras" and delete all results. Lastly, run conda install -c conda-forge keras, which should download version 2.3.1. You might need to run similar steps with TensorFlow (in fact, it's better you do, and first reinstall TensorFlow then Keras).
P.S., your code is probably from keras import Sequential, as sequential should error differently.