-
Notifications
You must be signed in to change notification settings - Fork 74.7k
ImportError: No module named '_pywrap_tensorflow' (MSVCP140.dll is present) #7705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@SiddGururani Please try changing your directory to a directory other than the one where you installed tf. |
Today is a corporate Google holiday so it might take a little to get a googler response. |
@daxlab I tried that. Didn't help. I'm assuming you're talking about changing the working directory from where I run python and subsequently import tensorflow. @Carmezim Yes, I checked MSVCP140.dll before trying to import tensorflow and after it failed, I did a fresh install of the VC redist package. Nothing changed. |
If you want to try uninstalling TensorFlow and installing with |
So when I use the PYPI package, it works. But gives the issues listed on #7621 Yes, I have one Python distribution. |
Are you getting OpKernel error? There are more recent nightlies (89) if you want to try as well. |
Yes, I get the OpKernel errors with the PYPI package. I'll try out using the latest nightly and see if it works. Shall keep you posted! |
The most recent nightly build also gave the same error. Just to make sure I'm right in saying that the MSVCP140.dll is in the path, here is the output of:
And at least the Anaconda and the Windows system folders are in my |
I believe my CUDA and cuDNN are setup properly since the PYPI tensorflow-gpu package is able to find the CUDA dlls, but then it gives me the OpKernel errors. |
@mrry: windows build issue |
@SiddGururani Can you check if the CUDA and cuDNN DLLs are in directories named in your |
Woah! So it looks like cuDNN wasn't setup properly. I put the dll, lib and .h file in CUDA's respective folders. |
Thanks for help resolving the previous issue. When I start a new session now though, it gives me these warnings:
Should I create a new issue for this? |
Those are simply warnings about performance. |
@SiddGururani Thanks for digging into the problem with cuDNN paths! Let us know if we can improve the installation instructions to avoid this. |
I think it would be helpful if you specifically instruct users to move the cuDNN files (the dll, lib and the header) from the cuDNN extracted folder into: |
I have similar problem. After installation of MS VC++ 2015 Redistributable Update 3 x64, the problem still exists. I have tried the above method. However, it still does not work. My environment: ---------------Update-------------------- Here are the error message when I "import tensorflow": Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/install_sources#common_installation_probl for some common reasons and solutions. Include the entire stack trace |
@ybsave cuDNN 8.0? I suggest you review your CUDA related DLLs making sure they're properly set in your |
@Carmezim Sorry for my typo. It was cuDNN 6.0. I have found the problem due to the cuDNN 6.0; when I switch to 5.1, everything works fine. |
@ybsave Glad to hear you figured it out. |
The problem was the cuDNN Library for me - for whatever reason cudnn-8.0-windows10-x64-v6.0 was NOT working - I used cudnn-8.0-windows10-x64-v5.1 - ALL GOOD! My setup working with Win10 64 and the Nvidia GTX780M:
If you run Windows 32 be sure to get the 32 bit versions of the files mentioned above. |
I had the same issue, was able to solve it by using cuDNN 5.1 instead of 6.0. Is there a reason why 6.0 is not working? Does it have something to do with Windows? Just curious |
I was having this issue and installing cuDNN 5.1 fixed it for me as well. |
I just solved the problem with reinstalling python35 using customize installation by checking all the boxes and then next, checking all the boxes again (especially the last two - Download debugging symbols and binaries). After that, using Still, it has many warnings when I test the program 😞 |
@jcomfort4 I have solved the problem by the method discribed above. I guess the program just need a file like 'cudnn64_5.dll' and named 'cudnn64_5.dll'. If you changed the name of 'cudnn64_6.dll' (which in cuDNN6.0) to 'cudnn64_5.dll' , it still worked.(But I haven' t tested it for further use.) |
@drophit I have the same issue and this solution works for me. Thanks a lot. |
I'm getting the same issue, and followed all of the above advice, no luck. It's super hard to debug, if its one or the other file that is missing. Couldn't Tensorflow be better at telling you what file it can't include? I'm trying this combination Windows 10 + Python 3.5.2 + cuDNN 5.1 + CUDA 8.0 + Tensorflow 1.3. I've tried all cuDNN versions from 7 to 5.1 (All the DLL's can exist in same dir, as they are named differently) msvcp140.dll is located all over my system, including a lot which PATH points to. |
@DinoP I believe the released version of TensorFlow 1.3 depends on cuDNN 6, so it's probably looking for |
Thank for the answer. As I wrote, I both have version 5.1, 6 and 7 installed in that dir. So should'nt be be that. The "v8.0\bin" dir looks like this: @mrry Also back to my point about Tensorflow not letting me know what file it's expects in the error output, make is tooo much harder to debug. |
So, I thought I had a breakthrough... did "pip uninstall tensorflow tensorflow-gpu" and then "pip install tensorflow-gpu" My suddenly script then didn't fail at the import of TF.... hurray... but only cpu devices were available (no gpu). Makes sense that it did not fail then, but I'm not sure why it stopped showing my gpu. Anyone knows how to force my script to use tensorflow-gpu or "re-enable" my gpu devices? |
Greetings, i had the same issues described above: Import errors as well as the case described 4 hours ago. What helped me in my case was in fact the cuDNN Version 6. I am using python 3.6, CUDA 8, cuDNN 6 and tensorflow-gpu 1.3.0 on Windows 10 x64. For cuDNN I extracted the content of bin, include and lib to the respective folders in ...\CUDA\v8.0\ I hope this resolves the issue for some of you guys. EDIT: What may help as well to check if tensorflow really uses GPU is this solution on stackoverflow. |
Been trying to install tensorflow since a few days now and guides hardly ever keep up with updates to newer components. Thanks @Adrian-Steinert, your combination of packages is the one that finally worked for me! |
@mrry @Adrian-Steinert I can confirm that at least for tensorflow version Wasted so much times due to this kind of hidden dll naming constraint, hope this can be helpful to other people who encountered |
Ok, so i think i finally found the solution to my problem. I've followed every guide out there, so was just about to give up. First of all, thanks @mrry creating this script: https://gist.github.com/mrry/ee5dbcfdd045fa48a27d56664411d41c So when going to the Nvidia download page, you get presented with 2 downloads, Base installer and "Patch 2". Because Patch 2 was a larger file size than base I thought this version contained everything. Also "Patch 2" installs with no problems, even though Base installation is missing. So it turned out that I missed the Base installation and didn't have CUDA properly installed, only the Patch. Hope this helps the others. |
..... only to discover that GPU is twice as slow as CPU at the task I'm trying solve (GTX1080) |
@guitarmind I can also confirm that this worked for me! This is huge, I spent ages and ages trying to solve this while having cudnn 5.1 because every single guide said that cudnn 6 doesn't work, but in reality cudnn 6 is required for the current tensorflow-gpu 1.3.0 |
@Innixma I did exactly the same....tried to reinstall python, CUDA, cuDNN, check environment variables so many times. Totally misled by all public guides until I saw this issue page. Could anyone update the official installation guide of TensorFlow to mention about this for the updates after |
I solve the exact problem by using Cudnn 6.0 instead of Cudnn 5.0 recently. (cudnn-8.0-windows10-x64-v6.0). While the document metioned https://www.tensorflow.org/versions/r1.3/install/install_windows is still wrong about Cudnn's version |
I spent forever on this issue only to find this open issue. Someone really needs to update the Windows guide |
@av8ramit Can we modify the webpage to point to cudnn 6? |
I happened to avoid the problem because I was lucky enough to read the 1.3.0 changelog where they mention that binaries are now build against cuDNN 6.0. Time to update the install guides (there's already people on StackOverflow scratching their heads) |
We are in the process of updating the website right now. Thank you for your patience and sorry for any inconvenience. |
Oh god....I fixed it on my machine! You guys are right! Tensorflow 1.3 requires cudnn64_6.dll not cudnn64_7.dll You should use the 6.0 CUDNN version with TF 1.3 |
cudnn64_6.dll work for me ,a "pan" help for me , ^o^,tks |
I had the same issue today in upgrading to 1.3.0. I had both cudnnv5.1 and cudnnv6.0, but in the PATH system variable, cudnnv5.1 was used. replaced it with cudnnv6 and all errors are gone! |
I just wrestled with this for a couple hours (Windows 10, Anaconda 4.4.0 64 bit). I had been trying to install tensorflow-gpu using pip with no success. I followed all the guides I could find, tried using Python 3.5.3, installed cudnn 5.1 and 6.0, tried different combinations using conda environments, and still ran into the same error. I found that installing via conda rather than pip worked the first time. Conda installed cudatoolkit, cudnn, libprotobuf, and protobuf and updated itself and vs2015_runtime. Apparently conda is better at putting all this stuff in the right place than I am. Praise conda. |
To resolve the problem in windows 10, I did the following: Open Anancoda prompt with administrative access and then run the following command. This will take care of everything paths, cuda, cudnn and dll files and will install everything in the particular place.
|
@sulaimanvesal it seems conda is not up to date for the windows platform, since it installs version 1.1 which belongs to almost 5 months ago while the current version is 1.3.0! |
@gunan would be a good idea to lock this thread? |
Locking due to this becoming a catchall for unrelated windows issues. |
Uh oh!
There was an error while loading. Please reload this page.
I installed the nightly build windows 64bit release of tensorflow from http://ci.tensorflow.org/view/Nightly/job/nightly-win/85/DEVICE=gpu,OS=windows/
using pip install in the Anaconda distribution of Python 3.5 (v4.1.1.0)
When I try to import tensorflow, I get the following error:
I checked the msvcp140.dll and it seems to be present in multiple locations of my %PATH% (in the anaconda folder, in system32, sysWOW64 and some other locations).
I also have environment variables setup for the CUDA path.
The issue filed here: #7529 is essentially the same as mine but the user resolved it by shifting development to a VPS running Ubuntu. It still doesn't solve the problem though.
Any help would be appreciated! :)
The text was updated successfully, but these errors were encountered: