简体   繁体   中英

Import tensorflow CPU error - nvcuda.dll not found

Apologies if this has been reported already at some other place, I have been looking for it quite some time, without success. I am trying to import tensorflow library (the CPU version only) and I am running into the below error:

ImportError: Could not find 'nvcuda.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Typically it is installed in 'C:\Windows\System32'. If it is not present, ensure that you have a CUDA-capable GPU with the correct driver installed.

From my understanding, this error occurs only for running the GPU version of the library. I double checked and I do not have tensorflow-GPU installed. I tried uninstalling and reinstalling tensorflow and I get the same error. I do not have a NVIDIA graphics card and my machine only has a Intel (R) UHD Graphics 620 card.

I am using Anaconda installation of Python and the Jupyter notebook to run my code. Any help would be appreciated.

As discussed in the comments, the problem was that you had not created a new environment for all your pip packages , which is the first recommendation to anyone installing TensorFlow by a tutorial.

The base environment of 'conda' should never be used to install Tensorflow packages. After creating the environment, simply go to a command prompt and type:

conda activate <the_environment_name_u_just_created>

Then you can run the following command to reinstall the CPU version of Tensorflow 2.0:-

pip install --ignore-installed --upgrade TensorFlow

Which is useful to clear out any previous broken installs and create a new one that should work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM