I am trying to execute a python file which has pytorch with lightning and torchvision modules. But after I downloaded and successfully installed whl file of pytorch in pi3 I am getting same error again and again.
The error is
ModuleNotFoundError: No module named 'pytorch_lightning.metrics'
Help would be highly appreciated as I am stuck for more than 3 days.
I have installed the modules using pip.
I found maybe the 'pytorch_lightning.metrics' are updated to 'torchmetrics' package, try changing 'import pytorch_lightning.metrics' to 'import torchmetrics'
Use instead:
from torchmetrics.functional import accuracy
Try installing this version
!pip install pytorch-lightning==1.2.2
I solved it with the following installation:
pip install -q test_tube transformers pytorch-nlp pytorch-lightning==0.9.0
Worth trying.
Related
The statement is:
from tensorflow.python.trackable import base as trackable
But the module not found error is coming up.
##### File "C:\Users\mahit\anaconda3\lib\site-packages\keras\dtensor\lazy_variable.py", line 26, in <module>
from tensorflow.python.trackable import base as trackable
ModuleNotFoundError: No module named 'tensorflow.python.trackable'
The piece of code is inside keras library. I dont understand why this module not found error is coming up. Becase this is a code that came with the package. Also not sure what trackable does. Please help me resolve this.
The solution for me was to install keras in version 2.9.0
pip install keras==2.9.0
I got rid of this error: uninstall tensorflow and install tf-nightly. Nevertheless, I got another error: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice
In python code, with Linux OS, that error could be solved by using command: os.environ['XLA_FLAGS'] = '--xla_gpu_cuda_data_dir=/usr/lib/cuda/'
I had the same problem for the past one month and I was not able to resolve it. Then finally I just uninstalled tensorflow and installed tf-nightly with immediately resolved the issue.
The issue occurs as tensorflow recently moved the keras out of the default package and now is only available through the tf-nightly install.
Hope this resolves the issue
I have the same issue and have been check the current dir of tensorflow, the trackable folder does not exist.
So here is an easy way.
Git clone from the url: https://github.com/tensorflow/tensorflow
Find the tensorflow -> python -> trackable
Copy the trackable folder to your tensorflow install dir (For example: C:\Users\xxxx\anaconda3\Lib\site-packages\tensorflow\python).
Uninstall tensorflow using pip uninstall tensorflow and install pip install tf-nightly
This fix worked for me perfectly well.
I just got this error in CI builds with a requirements.txt that had
keras
tensorflow==2.9.1
and I assume the error was caused by pip install -r requirements.txt taking the recently released Keras 2.10 version, which probably assumes it's running next to TensorFlow 2.10, and that the minor mismatch led to this import error.
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)
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 am going to use Bindsnet for Spiking Neural Network and I have imported it using
! pip install bindsnet in jupyter notebook.
and My Python's version is 3.6.
when I run:
from bindsnet.network import Network
It returns below error message:
ModuleNotFoundError: No module named 'bindsnet.network'
Can you please let me know how to solve this?
It turned out that using pip install was not successful so I changed the code for installation to :
!pip install bindsnet --ignore-installed
and now I can run from bindsnet.network import Network with no error.
I installed sci-kit learn with the installer scikit-learn-0.13.1.win32-py2.7.exe but when I try to call it in Canopy and iPython I get the following error: "ImportError: No module named sklearn".
I tried the following solutions found online but non of them work
Running python setup.py install in the directory and got this error: "ImportError: no module named sklearn._build_utils"
Tried pip install - U scikit-learn but the download keeping on timing out
Tried easy_install - U scikit-learn but the download also kept on timing out
I'm wondering if it is because I am using Canopy (Free version) and I should maybe uninstall it and install all my packages again using vanilla Python.
Thanks.
Have you tried adding sklearn to your python path manually? Have a look at this thread, it might help!
How to add to the pythonpath in windows 7?