How to install TensorFlow with Pip? - python

I'm trying to install tensorflow and I get this error. How do I fix this?
I am very new to coding so small words would be helpful. P.S. I'm using miniconda3 if that's important

Related

PyTorch Error loading "\lib\site-packages\torch\lib\shm.dll" or one of its dependencies

I cannot use PyTorch and Shap getting this error
PyTorch Error loading "\lib\site-packages\torch\lib\shm.dll" or one of its dependencies.
I have tried
to uninstall and re-install PyTorch, failed
create a new conda environment and reinstalled everything including PyTorch, failed
to install .NET C++ as suggested in other posts, but it was already installed
I am not an expert on SO and dependencies, but i find it strange that there is not an easy way to fix it. Any idea?
I manage to get past the error by conda install cudatoolkit
i fixed Error loading "torch\lib\shm.dll" or one of its dependencies
use : conda install cudatoolkit
if still getting the above error after running the above command. you should restart the computer and then turn on anaconda again.
I would be happy if I could help

Can't install Tensrflow

I'm a beginner in Deep Learning and NLP stream. I was trying to install Tensorflow but it is giving me an error. Can anyone please help me how to solve this?
This is the error I'm getting
I was watchig an YouTube video for Toxic Comment Classification and thought should try that out for better practice. After creating an enviroment for the file I triedd to install Tensorflow but it threw this error. I updated my Anaconda, Updated python to 3.11 and pip to 22.3 but still it is not working.
Welcome to Stack Overflow!!
Have you tried installing each package indivually?
Like this
pip install tensorflow
pip install tensorflow-gpu
And so on
I ran your CLI commands from the picture separately as-well.
The error you are getting is from tensorflow-gpu command.
I've found a link for you, from where you can learn about it. [link]

downgrade tensorflow GPU from v2.8 to v2.7 in google colab

I have some models I trained using TF and have been using for awhile now but since V2.8 came out I am having issues with the models based in MobileNetV3 (large and small), I posted the issue on the tensor-flow git and am waiting for a solution. In the mean time I wan to make some predictions on colab using V2.7 instead of 2.8. I know this involves installing CUDA and and cuDNN. I am really in experienced at this level and setting up TF. does anyone know how to proceed with this? I saw this post but was hoping for a less intensive solution. like can I 'flash' an old colab machine that has 2.7 setup?
as a side note, shouldn't colab have options like this? the main reason I am using colab is that I can run my code anywhere and that it is repeatable.
also I can install and run my code for V2.7 for the CPU version but I want to run on the GPU.
thanks for your help!
edit: sorry I did a poor job at explaining what I already tried. I have tired using pip
!pip install --upgrade tensorflow-gpu==2.7.*
!pip install --upgrade tensorflow==2.7.*
but I get this error
UnknownError: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.
I have also pip uninstalled keras, TF and TF-GPU before installing and I get the same error. yes I restart the runtime as well. someone mentioned that conda tried to install everything when installing TF, is this a possible solution?

Using GPU with Keras

i'm actally facing a probleme since last friday and didn't find a solution for the moment.
First of all, you need to know that i'm a beginner on linux,i'm trying to do some deep learning in my internship, and i discovered that even if my company have a 1080 Ti, keras wasn't using it, so have the job to correct this.
I am trying to use Keras with GPU. I installer Tensorflow by following these steps : https://www.tensorflow.org/install/install_linux
I also installer CUDA,cuDNN.
I found on my machine an older installation of CUDA (version 7.5). I installed version 9.2 without uninstalling version 7.5. I added the PATH variables but it seems like it is not taking in account : [][https://i.stack.imgur.com/B3Pqm.png]
I tried to uninstall CUDA version 7.5 but i don't know how to do it, since in the usr/local folder, there is no cuda-7.5 folder.
When i enter nvidia-smi in the prompt, it works correctly. I installed tensorflow and tensorflow-gpu, but i does not work : [][https://i.stack.imgur.com/78gPd.png]
Did anyone know how to help me? i Guess the solution of my probleme is not really complicated for someone who knows Ubuntu, and i feel like i'm loosing a lot of times doing something i don't really understand.
If someone need some further informations in order to help me, feel free to ask.
Thank you
Uninstall tensorflow and install only tensorflow-gpu. You should not install both. If you are using keras, then install keras-gpu.
Let's say you are working with conda and you want to tidy up all this. Do
conda remove keras
conda remove tensorflow*
conda install keras-gpu
If you are not, then i highly recommend Anaconda for dealing with these issues which you seem to be having stress-free.

AttributeError: module 'tensorflow.python.pywrap_tensorflow' has no attribute 'TFE_Py_RegisterExceptionClass'

I am trying to develop some time-series sequence prediction, using the latest resources available. To that end, I did check the example code from TensorFlow time-series, but I'm getting this error:
AttributeError: module 'tensorflow.python.pywrap_tensorflow' has no attribute 'TFE_Py_RegisterExceptionClass'
I'm using Anaconda. The current environment is Python 3.5 and TensorFlow 1.2.1. Also tried TensorFlow 1.3, but nothing changed.
Here is the code I'm trying to run. I did not find anything useful related to the issue on Google. Any ideas on how to solve it?
As Conan.Net wrote:
I tried to remove/clean some environments from anaconda and install
all again and it work this time.
This solution worked for me as well, so though not ideal, it will solve the problem. If you are using anaconda, it might happen when installing some packages and then removing them (e.g. tensorflow vs tensorflow-gpu) leaves some dependencies hanging. In my case, I used:
conda remove --name py2_tf_gpu --all
then
conda create --name py2_tf_gpu python=2 anaconda pandas numpy scipy jupyter
source activate py2_tf_gpu
pip install --ignore-installed --upgrade tensorflow-gpu
pip currently installs a later(1.4) than anaconda(1.3) version and I had need for it.
Maybe the version of tensorflow doesn't match the version of keras.
Using a lower version of keras solve this problem

Categories

Resources