-
Notifications
You must be signed in to change notification settings - Fork 74.3k
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
Installation issue with Tensorflow-cpu, no module named '_pwyrap_tensorflow_internal' #22512
Comments
Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks. |
I've updated the form accordingly |
@ymodak I have made some progress. It turns out, I was building tensorflow from an Anaconda shell. I removed Anaconda and installed standard python 3.6.6 64 bits. By doing so, the initial problem went away.
Here is the code to reproduce:
Steps to reproduce:
|
I finally managed to catch the exception happening at import time, application is raising Could this be related to AXV instructions not supported ? The processor of the VM is an Intel Xeon E5-2623 v4 that apparently supports AVX2. |
@Overdrivr This is not a bug. You can run some sanity checks on the second machine to make sure the environment is set up correctly and dependencies are installed properly. |
You're correct, there is a configuration issue on the second machine. I have installed python 3.6.6 on it, created a new virtual env, only containing tensorflow, and can reproduce the issue. What puzzles me is that I have installed tensorflow-cpu on it, and I still get I have ran the following sanity check (updated for tensorflow 1.10.0, Cuda 9.0, cuDNN 7.0.X):
Output:
Basically, the sanity check does not highlight any error, yet there seems to be an issue loading some DLL. This is very weird, because I have installed TF-cpu and GPU on another machine with exactly the same specs two hours before that one (They are both freshly created machines on a cloud provider with the same base Windows 10 image). |
I have tried TF 1.5 and it solves the issue. TF can be imported just fine. So, clearly, it has be an issue with AVX. But it is stated here (and everywhere else) that the Xeon E5-2623 v4 supports AVX2, so I guess it should support AVX too, right ? To be sure, I wrote a small script that fetches CPUID and checks if the hardware supports AVX.
And this is what I get:
Just the name of the micro-architecture is pretty self-explanatory. I would like to give a big THANKS to intel for advertising their processor to support AVX when they clearly don't (and for wasting our time). |
While we're at it, I'm getting the same problem with tensorflow-cpu... on another freshly created machine.. that supports AVX. Fun ride. I'm leaving this here for documentation, it might help others. In my production virtualenv with tensorflow-cpu + a bunch of other packages, I get the following error (the output comes from a tensorflow-install-checker tool that I will release in public domain):
In another virtualenv with only tensorflow-cpu, I get this one:
Hum weird right ? Let's summarize:
If you look closely, the Now, why that's a problem:
After doing so on my VM, importing TF in both virtualenvs now runs properly. 🥂
Maybe it might be worth mentioning it in the install docs. |
@lamberta Can we add this requirement to our windows installation docs?
|
@gunan I can highlight the need to install Microsoft Visual C++ 2015 Redistributable and to make sure the DLL is installed in the system32 folder. Can also add the error message to this page: https://www.tensorflow.org/install/errors (and link to this issue). But is this something tensorflow can detect and provide a more useful error message? "Can not find msvcp140.dll in system32 directory" (or something) |
Certainly. Both are things we need to do. |
Nagging Assignee @wt-huang: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly. |
Closing this issue as the PR is merged. |
PLEASE HELP!!!
|
It's because it's not TF that fails to load, it's protobuf: protocolbuffers/protobuf#5046 (comment) Apparently, downgrading to protobuf 3.6.0 (most likely you have 3.6.1) does the trick |
The problem exists for every version of tensorflow 1.5 - 1.12 (cpu). But downgrading protobuf from 3.6.1 to 3.6.0 does the trick. @Overdrivr thanks for the solution |
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/errors for some common reasons and solutions. Include the entire stack trace Please help me with this error |
(3) E:\GitHub\3\EasyRL>python demo/run_dqn_on_pong.py 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/errors for some common reasons and solutions. Include the entire stack trace I have no idea what I can do with the error message... |
Installing Microsoft Visual Studio 2019 community version worked for me on too. Thanks! I am using Tensorflow 2.1.0 + CUDA 10.1 |
HI, ===========
|
Simply running the command-prompt/anaconda-prompt as administrator should solve the problem of the downgrade permission. |
I have tried all the above methods. But still getting this error. I have a doubt. Actually what are the things to be installed to get tensorflow work? I even have visual c++ redistributable 2005. And tried changing different versions of tensorflow.
|
After successfully installed tensorflow. I get the same error again n again........... C:\Users\ritu\AppData\Local\Programs\Python\Python37\Scripts>python
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/errors for some common reasons and solutions. Include the entire stack trace |
Look if you try to install version 2.0.0 so you must Update pip first then install tensorflow or tensorflow-gpu will work. Resource :: https://www.tensorflow.org/install/pip?lang=python3 |
This fixed it for me: |
thank you so muuuuch |
This also worked for me after downgrading from 2.1.0. |
Check that all the dependencies are installed. I was missing VC redist. |
This worked also for me on 2.1.0 |
Hi. Semi-experiencde programmer, new to Python, novice Linux user taking a course on tensorflow, but stuck. For context, I'm using Jupyter notebooks because that is the tool the online training videos are using, and easy to follow along in real time. This is my first post to github too. This thread has been helpful, as I've seen similar errors, but downgrading to 2.0.0 created other issues. Please read on. SETUP: ISSUE ImportError Traceback (most recent call last) C:\ProgramData\Anaconda3\lib\imp.py in load_dynamic(name, path, file) C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python_init_.py in C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in ImportError: Traceback (most recent call last): Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/errors I tried downgrading to tensorflow 2.0.0 using "pip install tensorflow==2.0.0" from the Anaconda powershell window. Going back to the same Jupyter notebook, "import tensorflow as tf" executed without any errors. Great. But then I continued on in the training and found the tensorflow constant and variable methods threw errors. Code and errors below CODE - Constantconst_1 = tf.constant(value=[5.0], ERRORTypeError Traceback (most recent call last) TypeError: constant() got an unexpected keyword argument 'verify_shape' CODE - variablevar_1 = tf.Variable(initial_value=[1.0], ERROR 1TypeError Traceback (most recent call last) C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\ops\variables.py in call(cls, *args, **kwargs) TypeError: _variable_v2_call() got an unexpected keyword argument 'collections' ERROR 2 (after removing collections argument)TypeError Traceback (most recent call last) C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\ops\variables.py in call(cls, *args, **kwargs) TypeError: _variable_v2_call() got an unexpected keyword argument 'expected_shape' And if I remove the verify_shape argument from constant and collections and expected_shape from variable, they execute fine, but I fear I will run into other issues eventually. Rather than continuing this guessing game, I thought I'd check here to see if anyone has any thoughts. Any help is GREATLY appreciated. I ran "pip list" and pasted below in case there any version issues. Thanks in advance! Package Versionabsl-py 0.9.0 |
I see an article and I ,finally solve this problem.Win10,anaconda3,tensorflow2.2.0. enter cmd that's all.I hope it will help you |
pip install tensorflow==2.0.0 |
how can I solve this problem ImportError: Traceback (most recent call last): Failed to load the native TensorFlow runtime. |
same error |
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/errors for some common reasons and solutions. Include the entire stack trace |
I am having this error. How to solve this? |
Same problem here. Somewhere hidden in the long thread above there is the hint to go back to tensorflow 2.0.0: That solved it for me. |
I am having that problem, too! Expect solutions, thanks!
|
Correction: pip install tensorflow==2.0.0 |
System information
Describe the problem
The error trace is this:
On the other hand, doing the same process with tensorflow(-cpu) works fine.
I ruled out CUDA/cuDNN installation issue, because if I run my python application using python, it works fine with the GPU version.
I have tried checking at the .exe with dependency_walker, but appart from false-positive missing
API-MS-*
andEXT-MS-*
DLLs, I don't see anything obvious.So I'm stuck here.
What discrepancy could create an import issue with tensorflow-gpu and not with tensorflow-cpu ?
The text was updated successfully, but these errors were encountered: