On Windows 10 with CUDA 8 and CuDNN 7 installed, I have troubles installing Tensorflow (both the GPU and CPU edition, though I'll focus on the GPU version).
When trying to install it system-wide with python3.5 using pip install tensorflow-gpu, it reports that there are no matching packages.
If I instead install it using the community supported anaconda distribution (using the steps described at the documentation page, it correctly installs Tensorflow, but when I import it into a program the following error is shown:
>>> import tensorflow as tf
[...]
ImportError: DLL load failed: The specified module could not be found.
[...]
ImportError: No module named '_pywrap_tensorflow_internal'
[...]
Failed to load the native TensorFlow runtime.
Entire stack trace is available on paste-bin.
For CUDA, I've set the following system environment variables: CUDA_HOME, CUDA_PATH, and CUDA_PATH_V8_0 as suggested by various tutorials. Furthermore cuDNN has been installed using nVidia's instructions, and path variables have been set to CUDA\v8.0\bin, and CUDA\v8.0\libnvvp.
It's probably because Tensorflow now only supports cuDNN v6.0 or v6.1, at least is what's maintained in the Installation Guide for Windows.
I had the same problem, but after updating Tensorflow from an old version to a newer one where the cuDNN had to be updated.
Related
I am working on a Win10 machine, with python 3.6.3 and using tensorflow 1.9, pip 18.0. I did not provide an option to install tensorflow with gpu, (i.e.), according to this link1, I used
pip install tensorflow
and did not provide option for using GPU. However, when trying to import tensorflow, I am faced with the following error
ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'
After following various links, link2,link3, I installed the Visual studio update 3 and also used the script provided tensorflow self check, and came across this following error:
Could not load 'cudart64_80.dll'. .....
Could not load 'nvcuda.dll' .......
Could not load 'cudnn64_5.dll' ........
Why is my Tensorflow looking for these packages, when I installed it without GPU? MY system doesn't house a GPU at the moment. I tried uninstall and reinstalling with the upgraded pip 18.0, but the issue persists. How can this be rectified.?
The self-check script from that link is labeled as "DEPRECATED" so it may not work for the latest version (at least not for TensorFlow 1.9 with GPU since that would require cudart64_90.dll instead of cudart64_80.dll). Also, the script simply checks all possible missing files which could be needed by either the CPU or the GPU version. The detailed message tells you which files are only needed by the GPU version.
You may first double-check the GPU version is not installed, if you are not sure about it, by executing pip show tensorflow-gpu. There should be nothing showing up if you have only installed the CPU version.
I encountered a problem yesterday while upgrading the GPU version from 1.8 to 1.9. The problem might not be exactly the same as yours but could be related since my problem was also caused by a failed _pywrap_tensorflow_internal import due to a DLL loading failure. If your problem is also caused by a DLL loading failure, which is explicitly mentioned in the stack trace message, you could consider using this approach to pinpoint the problem:
Use the DLL dependency analyzer Dependencies to analyze <Your Python Dir>\Lib\site-packages\tensorflow\python\_pywrap_tensorflow_internal.pyd and determine the exact missing DLL (indicated by a ? beside the DLL).
Look for information of the missing DLL and install the appropriate package to resolve the problem.
In my case the missing library is VCOMP140.dll, which is Microsoft's OpenMP library and was not needed by the 1.8 version. I installed VC++ Redistributable for VS 2017 and the problem is resolved.
Status 2020-07-12: tensorflow-gpu is integrated into the regular installation - which causes problems as also in your case. This is true since version 2.0.0 - see here on github.
A huge list of different wheels/compatibilities can be found here on github.
By using this, you can downgrade to almost every availale version in combination with the respective for python. For example:
pip install tensorflow==2.0.0
(What you have to pay attention about is that you cannot install arbitrary versions of tensorflow, they have to correspond to your python installation. So previous to installing Python 3.7.8 alongside 3.8.3 (or analogously for your case), you would get
ERROR: Could not find a version that satisfies the requirement tensorflow==2.0.0 (from versions: 2.2.0rc1, 2.2.0rc2, 2.2.0rc3, 2.2.0rc4, 2.2.0, 2.3.0rc0, 2.3.0rc1)
ERROR: No matching distribution found for tensorflow==2.0.0
)
Besides your usecase without a GPU, this should also be useful for legacy CPU without AVX support and GPUs with a compute capability that's too low.
If you only need the most recent releases (which it doesn't sound like in your question) a list of urls for the current wheel packages is available on this tensorflow page. That's from this SO-answer.
Note: This link to a list of different versions didn't work for me.
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.
please solve this error i am doing FYP
First of all, my computer does not have an Nvidia card. So I can not install CUDA driver. I downloaded nvcuda.dll and executed
regsvr32 C:\Windows\System32\nvcuda.dll
instruction, they make a fire so as to compile all TensorFlow code that note
ImportError: Could not find 'nvcuda.dll'.
Anyway, please reinstall your TensorFlow:
pip uninstall protobuf
pip uninstall tensorflow
and then
pip install protobuf
pip install tensorflow
The error because , your system couldn't find CUDA enable for tensorflow-GPU version. Please refer link for installing tensorflow-GPU in here. If you want to access GPU version you have to install CUDA toolkit first. Make sure that when you are installing CUDA toolkit and cuDNN should support to your tensrflow version.
I am trying to work with tensorflow, but the DNNClassifier (and the other estimators) are not available from tf.estimator.
I am running Python 3.6 within Anaconda on Windows 10. I used conda install tensorflow to load and import tensorflow as tf to import the package.
When I try to use DNNClassifier, I get the error message:
AttributeError: module 'tensorflow.python.estimator.estimator_lib' has no attribute 'DNNClassifier'
Have any others had this problem?
Install using pip. Install the CPU version unless you have an nvidia GPU.
ImportError: libcuda.so.1: cannot open shared object file: No such file or directory
Failed to load the native TensorFlow runtime.
This error is appeared when import tensorflow.
I need to know steps to solve this problem.
If you are using TensorFlow with GPU, you need to install CUDA and cuDNN. Please follow instructions on https://www.tensorflow.org/install/
If you have already install CUDA and cuDNN, but still get this error, then you probably forgot to export your libraries: for Linux, you may need to set LD_LIBRARY_PATH to include CUDA libraries.
After installing TensorFlow 1.11 GPU via Anaconda "conda install tensorflow-gpu" I also experienced the same problem. Before TF 1.11 I used TF 1.04. Just before the TF update I updated Nvidia Driver to the version 396 through ppa.
There was no trace of libcuda.so.1 in my entire linux.
After many trials, the problem was solved when I changed the nvidia driver to 390. The 390 version inserted libcuda.so.1 to /usr/lib/i386-linux-gnu directory, which evidently solved the problem.
I want to implement this example. And thus I need to install python along with some libraries including Scikit-Learn, Numpy, Scipy, matplotlib.pyplot, Pandas, Keras, TensorFlow on my Windows 10 machine.
Currently, I can not use my GPU with TensorFlow. I tried installing CUDA. But still having difficulties setting path variables for python. I also tried installing Tensorflow with Anaconda. But that didn't help.
May I get a suggestion on installing python and its machine-learning packages on Windows with Nvidia GPU support in a fashion that doesn't have dependency issues?
Install python 3.6. Then use pip to install those packages. pip should be bundled with your Python install.
Anaconda has caused me many issues on windows personally. Try to avoid it if possible in my opinion.
I also install tensorflow recently, I find it's very smoothly. As you have installed vs2015, you can then install cuda. When you install the latest cuda, it will config the environment path and config for vs2015 automatically. After this, install python3.5, then use pip install tensorflow. Then you can run the tesorflow demo, when you encounter path issue, you just add it to the path, I remeber there are very file path issue. And when you use python, sometime you'll encounter module not find. Then just install these modules with pip.