ModuleNotFoundError: No module named 'tensorflow.python.checkpoint' - python

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

Related

Error: cannot import name 'SpearmanRConstantInputWarning' from 'scipy.stats'

I'm getting an error when importing the skbio package on Google Colab. The error message is related to SpearmanRConstantInputWarning of the scipy.stats package. What should I do to solve this problem?
I've tried to uninstall and install skbio and scipy, but it has not worked.
Seems to be some issue with the version. If you run
pip install scikit-bio==0.5.6
it shouldn't show that problem, at least it worked when I tried for 0.5.6 and 0.5.5 in Colab.
I had a similar problem, but could not downgrade to scikit-bio==0.5.6 as it conflicted with my Python version (3.10). An alternative workaround is downgrading scipy:
conda install -c conda-forge scipy=1.8
Presumably which package to downgrade will depend on your circumstances.
(Would have added as a comment to 3991santiago's answer but I do not have the reputation)

How to fix "ModuleNotFoundError: No module named 'keras.layers.advanced_activations' "

I'm trying to import imageai
from imageai.Detection import VideoObjectDetection
but get error message below
ModuleNotFoundError: No module named 'keras.layers.advanced_activations'
My tensorflow version 2.9.1,
keras version 2.9.0,
keras-preprocessing version 1.1.2,
image ai version 2.1.5,
I installed the imageai via pip install imageai-2.0.2-py3-none-any.whl and download from here.
The following code is an example for calling several types of advanced activation, Try to call it by
from keras.layers import ELU, PReLU, LeakyReLU
The import works with keras version 2.9.0 as below.
from keras.layers import LeakyReLU
I encountered the same error today. Downgrading my keras to 2.1.0 and tensorflow to 2.2.0 got rid of the error.
I faced the same error. ModuleNotFoundError: No module named 'keras.layers.advanced_activations'
To solve this problem:
Try to install TensorFlow 2.8.2 which is compatible with Keras 2.8.0
pip install tensorflow==2.8.2
Please install imageai using this link or use below code as you must install few libraries before installing imageai.
pip install cython pillow>=7.0.0 numpy>=1.18.1 opencv-python>=4.1.2 torch>=1.9.0 --extra-index-url https://download.pytorch.org/whl/cpu torchvision>=0.10.0 --extra-index-url https://download.pytorch.org/whl/cpu pytest==7.1.3 tqdm==4.64.1 scipy>=1.7.3 matplotlib>=3.4.3 mock==4.0.3
pip install imageai --upgrade
then import VideoObjectDetection as below:
from imageai.Detection import VideoObjectDetection

ImportError: cannot import name 'dtensor' from 'tensorflow.compat.v2.experimental'

I'm trying to create object detection using tensorflow as an assignment.
ImportError: cannot import name 'dtensor' from 'tensorflow.compat.v2.experimental' (c:\Project\.venv\lib\site-packages\tensorflow\_api\v2\compat\v2\experimental\__init__.py)
I would appreciate any help!
I got the same error. I downgraded to Keras v2.6.0, which fixed the issue.
Hence, as of 16.05.2022, this seems to be caues by a bug in v2.9.*
To downgrade to v2.6.0, run:
!pip install keras==2.6.*
Please try again by upgrading the TensorFlow version to the latest version 2.9 and restart the kernel(runtime) to fix this issue.
!pip install tensorflow==2.9
#Or
!pip install --quiet --upgrade --pre tensorflow
For example:
import tensorflow as tf
from tensorflow.experimental import dtensor
print('TensorFlow version:', tf.__version__)
mesh_1d = dtensor.create_mesh([('x', 6)])#, devices=DEVICES)
print(mesh_1d)
Output:
TensorFlow version: 2.9.1
<tensorflow.dtensor.python.layout.Mesh object at 0x7f890d7ce690>
Please check this link for more details.

problem in upgrading scikit-image version

On my system spyder version '0.13.1' is installed and I want to use
from skimage.filters import unsharp_mask
the error comes:
ImportError: cannot import name 'unsharp_mask
then I treid to upgrade the version using:
1st passed;
!pip install scikit-image
then I passed:
!pip install --upgrade scikit-image
then still version is same which is '0.13.1'.
What should I do?
The problem is resloved with the help of Anaconda official video tutorial :
https://anaconda.cloud/tutorials/getting-started-with-anaconda-individual-edition?source=install

Error importing tensorflow (just installed) python 3.7

I have python 3.7 installed on a Windows 10 machine, no custom stuff at all, to install tensorflow I used:
pip3 install --user --upgrade tensorflow
but when I try importing it using:
import tensorflow
in a python script or shell it gives me the following error:
ImportError: DLL load failed: The specified module could not be found.
Am I doing something wrong?
edit: By the way pip version is 20.0.2, I precedently tried with pip 10.x and got the same result.
Regarding https://github.com/tensorflow/tensorflow/issues/35749 or https://github.com/tensorflow/tensorflow/issues/36859 (and the amount of same duplicate issues) there are some recents problems with tensorflow 2.1 for some windows computers.
A fix so far, is to use tensorflow 2.0 on windows :
pip install tensorflow==2.0
For more details, this is quite detailed : https://github.com/tensorflow/tensorflow/issues/36167#issuecomment-577886156

Categories