Installation of TensorFlow 2.1.0 was successful, but TensorFlow import failed.
Open question:
Is there a library that is in a different location/not installed on the system that cannot be loaded?
Procedure for reproduction:
1) create environment
conda create --name tensorflow21_env
2) activate environment
conda activate tensorflow21_env
3) install
conda install python=3.7
pip install tensorflow-cpu #install tensorflow=2.1.0;
4) test
python -c "import tensorflow as tf"
Stacktrace:
Traceback (most recent call last):
File "C:\Anaconda3\envs\tensorflow21_env\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Anaconda3\envs\tensorflow21_env\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Anaconda3\envs\tensorflow21_env\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\Anaconda3\envs\tensorflow21_env\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Anaconda3\envs\tensorflow21_env\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Anaconda3\envs\tensorflow21_env\lib\site-packages\tensorflow\__init__.py", line 101, in <module>
from tensorflow_core import *
File "C:\Anaconda3\envs\tensorflow21_env\lib\site-packages\tensorflow_core\__init__.py", line 40, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Anaconda3\envs\tensorflow21_env\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "C:\Anaconda3\envs\tensorflow21_env\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "C:\Anaconda3\envs\tensorflow21_env\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Anaconda3\envs\tensorflow21_env\lib\site-packages\tensorflow_core\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Anaconda3\envs\tensorflow21_env\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Anaconda3\envs\tensorflow21_env\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Anaconda3\envs\tensorflow21_env\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Anaconda3\envs\tensorflow21_env\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\Anaconda3\envs\tensorflow21_env\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Anaconda3\envs\tensorflow21_env\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.
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
above this error message when asking for help.
Installation Output:
Output: conda install python=3.7
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: C:\Anaconda3\envs\tensorflow21_env
added / updated specs:
- python=3.7
The following NEW packages will be INSTALLED:
ca-certificates pkgs/main/win-64::ca-certificates-2020.1.1-0
certifi pkgs/main/win-64::certifi-2019.11.28-py37_0
openssl pkgs/main/win-64::openssl-1.1.1d-he774522_4
pip pkgs/main/win-64::pip-20.0.2-py37_1
python pkgs/main/win-64::python-3.7.6-h60c2a47_2
setuptools pkgs/main/win-64::setuptools-45.2.0-py37_0
sqlite pkgs/main/win-64::sqlite-3.31.1-he774522_0
vc pkgs/main/win-64::vc-14.1-h0510ff6_4
vs2015_runtime pkgs/main/win-64::vs2015_runtime-14.16.27012-hf0eaf9b_1
wheel pkgs/main/win-64::wheel-0.34.2-py37_0
wincertstore pkgs/main/win-64::wincertstore-0.2-py37_0
Proceed ([y]/n)? y
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
The dependency walker confirms that all DLLs could be loaded (download dependency walker).
dependency_trace
Addon:
path for dependency walker
C:\Anaconda3\envs\tensorflow21_env\Lib\site-packages\tensorflow_core\python\_pywrap_tensorflow_internal.pyd
Update:
My processor supports neither AVX nor AVX2 and therefore the tensorflow pip package could not be installed or to be more precise the tensorflow package could not be imported.
Interim solution:
The interim solution for legacy & low-end CPU without AVX support is to install SSE-prebuild-binaries for tensorflow.
Go to tensorflow-windows-wheel and follow instruction to install either tensorflow 2.0.0 or 2.1.0.
Try this method:
Uninstall the TensorFlow package that you installed using pip and reinstall using conda install tensorflow this may work! Now you can import TensorFlow without problems. I hope this can help you.
If you need more detailed steps. Here, you can do the following below.
Run the anaconda prompt as an administrator. (right click-> run as administrator).
pip uninstall tensorflow
Close anaconda prompt.
Again run anaconda prompt as administrator.
type:
conda install tensorflow
It will ask for some y / n
Type y.
Now after all done, change your python interpreter's environment to anaconda environment where you installed tensorflow.
Now try importing tensorflow.
I hope this helps.
Related
I have installed tensorflow in the anaconda environment. I have installed the latest anaconda and tensorflow by "conda install tensorflow-gpu". When I try to import tensorflow it works in the jupyter notebook. But the same code does run when I try to run from python terminal or when I run by "start debugging" from vs code. This is the error I am getting:
Traceback (most recent call last):
File "c:\Users\Admin\.vscode\extensions\ms-python.python-2019.4.12954\pythonFiles\ptvsd_launcher.py", line 43, in <module>
main(ptvsdArgs)
File "c:\Users\Admin\.vscode\extensions\ms-python.python-2019.4.12954\pythonFiles\lib\python\ptvsd\__main__.py", line 410, in main
run()
File "c:\Users\Admin\.vscode\extensions\ms-python.python-2019.4.12954\pythonFiles\lib\python\ptvsd\__main__.py", line 291, in run_file
runpy.run_path(target, run_name='__main__')
File "C:\Users\Admin\Anaconda3\envs\tf-gpu\lib\runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "C:\Users\Admin\Anaconda3\envs\tf-gpu\lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "C:\Users\Admin\Anaconda3\envs\tf-gpu\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "d:\Projects\SASRec\SASRec Pytorch\main.py", line 7, in <module>
import tensorflow as tf
File "C:\Users\Admin\Anaconda3\envs\tf-gpu\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Users\Admin\Anaconda3\envs\tf-gpu\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\Admin\Anaconda3\envs\tf-gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\Admin\Anaconda3\envs\tf-gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Admin\Anaconda3\envs\tf-gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Admin\Anaconda3\envs\tf-gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\Users\Admin\Anaconda3\envs\tf-gpu\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\Admin\Anaconda3\envs\tf-gpu\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
Can anyone kindly give me a solution and make my life easier. Thanks!
You probably already had some version of python installed (e.g. 3.6.6) before installing Anaconda with Python 3.7 and prepared it to use TensorFlow.
Because Anaconda comes with its own instance of Python you have installed the TensorFlow dependencies into the Anaconda instance of Python.
When you use the console, you most likely use your non-Anaconda-Python instance, which does not have TensorFlow with all its dependencies installed.
You can either install the missing dependencies for your non-Anaconda-Python or start the script with the Anaconda version of Python. You can do the later by calling python using the full path like /path/to/anaconda/bin/python yourscriptusingtensorflow.py or prepending the anaconda binary path to your console's $PATH variable.
So, after a lot of installing, uninstalling and reinstalling and scraping various similar issues in github and stackoverflow, I got a pretty simple solution. In my system, I only have Anaconda installed and c++ build tools from Microsoft (2019), and nothing else. Then I installed tensorflow as follows:
conda install tensorflow-gpu=1.10
Apparently, this older version is compatible with the DLL and everything seems to work.
I´m trying to make my first try with Tensorflow using windows 8.1 and Pycharm but I get an Tensorflow error.
I also installed everything in a virtual env with pip and runned the code in the command line with the same result.
Some things I tried
I read other posts relating the issue to the msvcp140.dll and I do have the C++ distributable installed.
Also found info related to downgrading to python 3.5. I actually use Python 3.7 and wouldn´t like to downgrade. I´m worried other apps won´t work. Can anyone confirm it won´t work with Python greater than 3.5?
Also read info about using Conda, but a the same time other info saying to avoid it, naming pip as the officialy supported method.
Also found info about my Intel® Pentium® Processor B980 not supporting AVX instructions. Is this a must when using CPU or only when using the GPU?
Any clues? Thanks in advance!
The following is the error message I get:
Using TensorFlow backend.
Traceback (most recent call last): File "C:\Users\Lia
love\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\pywrap_tensorflow.py",
line 58, in
from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\Lia
love\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py",
line 28, in
_pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\Lia
love\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py",
line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "C:\Users\Lia
love\AppData\Local\Programs\Python\Python37\lib\imp.py", line 243, in
load_module
return load_dynamic(name, filename, file) File "C:\Users\Lia love\AppData\Local\Programs\Python\Python37\lib\imp.py", line 343, in
load_dynamic
return _load(spec) ImportError: DLL load failed: No se puede encontrar el módulo especificado.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:/Users/Lia
love/TestAi/Test1.py", line 4, in
from keras.models import Sequential File "C:\Users\Lia love\AppData\Local\Programs\Python\Python37\lib\site-packages\keras__init__.py",
line 3, in
from . import utils File "C:\Users\Lia love\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\utils__init__.py",
line 6, in
from . import conv_utils File "C:\Users\Lia love\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\utils\conv_utils.py",
line 9, in
from .. import backend as K File "C:\Users\Lia love\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\backend__init__.py",
line 89, in
from .tensorflow_backend import * File "C:\Users\Lia love\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\backend\tensorflow_backend.py",
line 5, in
import tensorflow as tf File "C:\Users\Lia love\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow__init__.py",
line 24, in
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import File "C:\Users\Lia
love\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python__init__.py",
line 49, in
from tensorflow.python import pywrap_tensorflow File "C:\Users\Lia
love\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\pywrap_tensorflow.py",
line 74, in
raise ImportError(msg) ImportError: Traceback (most recent call last): File "C:\Users\Lia
love\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\pywrap_tensorflow.py",
line 58, in
from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\Lia
love\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py",
line 28, in
_pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\Lia
love\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py",
line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "C:\Users\Lia
love\AppData\Local\Programs\Python\Python37\lib\imp.py", line 243, in
load_module
return load_dynamic(name, filename, file) File "C:\Users\Lia love\AppData\Local\Programs\Python\Python37\lib\imp.py", line 343, in
load_dynamic
return _load(spec) ImportError: DLL load failed: No se puede encontrar el módulo especificado.
Failed to load the native TensorFlow runtime.
Test code
I estimate this is not a problem about my code, but I include it just in case.
import pandas as pd
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
from keras.models import Sequential
from keras.layers import Dense
df = pd.read_csv("housepricedata.csv")
dataset = df.values
X = dataset[:, 0:10]
Y = dataset[:, 10]
min_max_scaler = preprocessing.MinMaxScaler()
X_scale = min_max_scaler.fit_transform(X)
X_train, X_val_and_test, Y_train, Y_val_and_test = train_test_split(X_scale, Y, test_size=0.3)
X_val, X_test, Y_val, Y_test = train_test_split(X_val_and_test, Y_val_and_test, test_size=0.5)
print("Keras model setup")
model = Sequential([
Dense(32, activation='relu', input_shape=(10,)),
Dense(32, activation='relu'),
Dense(1, activation='sigmoid'),
])
Intel Pentium processors do not support Advanced Vector Instructions ( AVX ) which are needed by TensorFlow if installed from PyPI through :
pip install tensorflow
Since, your CPU doesn't support AVX, you have two options to choose from:
Use Anaconda
Anaconda uses conda distribution index which is similar to PyPI. The TensorFlow conda build uses MKL ( Intel Math Kernel Library ). It works without AVX.
Download Anaconda as mentioned here and create a new conda enviroment as mentioned here. Run this command:
conda install tensorflow
Use builds from tensorflow-windows-wheel repo.
This repo contains a number of TensorFlow pip wheel files which are build using SSE instead of AVX. SSE build run without any compilation errors. Use this file from the repo.
Hope this helps.
Python virtual environments are used to isolate package installation from the system (recommended)
Make sure these installation:
python3 --version
pip3 --version
virtualenv --version
Create a new virtual environment by choosing a Python interpreter and making a .\venv directory to hold it:
virtualenv --system-site-packages -p python3 ./venv
Activate the virtual environment:
.\venv\Scripts\activate
Install packages within a virtual environment without affecting the host system setup. Start by upgrading pip:
pip install --upgrade pip
pip list # show packages installed within the virtual environment
pip install --upgrade tensorflow
#Verify the install:
python -c "import tensorflow as tf; tf.enable_eager_execution(); print(tf.reduce_sum(tf.random_normal([1000, 1000])))"
Open your project in pycharm and go to project setting and change the python run time to target this virtual env.
Hope this will help.
I am unable to install and import Tensorflow on my PC. I have tried the below approach as mentioned on https://www.tensorflow.org/install/pip#package-location. I have also tried installation using Conda but the same problem appears. MS Visual C++ is also installed as mentioned on https://www.tensorflow.org/install/pip#package-location
System information
OS Platform: Windows 7 Service Pack1 TensorFlow installed from (source
or binary):
https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.12.0-cp35-cp35m-win_amd64.whl
TensorFlow version: 1.12 Python version: 3.5.4 64-bit Installed using
virtualenv
Traceback (most recent call last):
File
"C:\Users\Desk\AppData\Local\Programs\Python\Python35\Scripts\venv\lib\si
te-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in from
tensorflow.python.pywrap_tensorflow_internal import * File
"C:\Users\Desk\AppData\Local\Programs\Python\Python35\Scripts\venv\lib\si
te-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28,
in
_pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\Desk\AppData\Local\Programs\Python\Python35\Scripts\venv\lib\si
te-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24,
in swig_i mport_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, descript ion) File
"C:\Users\Desk\AppData\Local\Programs\Python\Python35\Scripts\venv\lib\im
p.py", line 243, in load_module return load_dynamic(name, filename,
file) File
"C:\Users\Desk\AppData\Local\Programs\Python\Python35\Scripts\venv\lib\im
p.py", line 343, in load_dynamic return _load(spec) ImportError: DLL
load failed with error code -1073741795
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in File
"C:\Users\Desk\AppData\Local\Programs\Python\Python35\Scripts\venv\lib\si
te-packages\tensorflow_init_.py", line 24, in from tensorflow.python
import pywrap_tensorflow # pylint: disable=unused-im port File
"C:\Users\Desk\AppData\Local\Programs\Python\Python35\Scripts\venv\lib\si
te-packages\tensorflow\python_init_.py", line 49, in from
tensorflow.python import pywrap_tensorflow File
"C:\Users\Desk\AppData\Local\Programs\Python\Python35\Scripts\venv\lib\si
te-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in
raise ImportError(msg) ImportError: Traceback (most recent call last):
File
"C:\Users\Desk\AppData\Local\Programs\Python\Python35\Scripts\venv\lib\si
te-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in from
tensorflow.python.pywrap_tensorflow_internal import * File
"C:\Users\Desk\AppData\Local\Programs\Python\Python35\Scripts\venv\lib\si
te-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28,
in
_pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\Desk\AppData\Local\Programs\Python\Python35\Scripts\venv\lib\si
te-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24,
in swig_i mport_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, descript ion) File
"C:\Users\Desk\AppData\Local\Programs\Python\Python35\Scripts\venv\lib\im
p.py", line 243, in load_module return load_dynamic(name, filename,
file) File
"C:\Users\Desk\AppData\Local\Programs\Python\Python35\Scripts\venv\lib\im
p.py", line 343, in load_dynamic return _load(spec) ImportError: DLL
load failed with error code -1073741795
If your CPU didn't support AVX instructions, you will get ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed. (Win 10) or ImportError: DLL load failed with error code -1073741795 (Win 7) when using tensorflow official release 1.6.0 and up (pip install tensorflow)
You can use pip install [filename].whl which file download from sse2 folder instead of using official AVX binary.
Please verify whether the below command is working.
pip3 install --upgrade tensorflow
You can use the below link for reference of tensorflow-windows-wheel.
https://github.com/fo40225/tensorflow-windows-wheel
I have built tensorflow wheel without AVX.
https://github.com/fo40225/tensorflow-windows-wheel/tree/master/1.6.0/py36/CPU/sse2
I wish this .whl may help you.
You can install the wheel file with pip. First change the current directory to install location. Then,
pip install tensorflow-1.6.0-cp36-cp36m-win_amd64.whl
If its not working please try to resolve it by downgrading protobuf from 3.6.1 to 3.6.0:
pip install protobuf==3.6.0
Got it fixed post looking for similar answers in internet...I had to install the tensorflow version 1.5 and the tensorflow backend loaded seamlessly
I installed tensorflow on my mac via pip and I'm using anaconda as my IDE.
when I run the command
import tensoflow
I'm getting the following error:
Traceback (most recent call last):
File "<ipython-input-3-a649b509054f>", line 1, in <module>
import tensorflow
File "/Applications/anaconda3/lib/python3.5/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/Applications/anaconda3/lib/python3.5/site-packages/tensorflow/python/__init__.py", line 51, in <module>
from tensorflow.python import pywrap_tensorflow
File "/Applications/anaconda3/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/Applications/anaconda3/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/Applications/anaconda3/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/Applications/anaconda3/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "/Applications/anaconda3/lib/python3.5/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/Applications/anaconda3/lib/python3.5/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: dlopen(/Applications/anaconda3/lib/python3.5/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 10): Library not loaded: #rpath/libcublas.8.0.dylib
Referenced from: /Applications/anaconda3/lib/python3.5/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
Reason: image not found
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/install_sources#common_installation_problems
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
I also ran pip list in my terminal to check if it was installed properly.
It lists all the tensorflow libraries that I have installed.
I'm using Anaconda v1.6.8 and Spyder v3.2.3
I can see that you have 2 versions of tensorflow. with (1.1.0) and without (1.3.0) gpu support. But error you are getting is because the gpu libraries are not properly installed.
For tensorflow-gpu==1.1.0 follow these instructions.
Unfortunatelly tensorflow dropped support for gpu on Mac since v1.2, but this answer may help you setup for a higher version.
I am trying to install Tensorflow with GPU support on Windows 10 according to the following guide: https://nitishmutha.github.io/tensorflow/2017/01/22/TensorFlow-with-gpu-for-windows.html
However, I got the following error when I import tensorflow in Conda Python 3.5.2:
How I fix this dll-not-found error? 'pip install tensorflow-gpu' did not give any errors.
File "", line 666, in _load_unlocked
File "", line 577, in module_from_spec
File "", line 906, in create_module
File "", line 222, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 41,
in from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\ProgramData\Anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in _pywrap_tensorflow_internal = swig_import_helper() File "C:\ProgramData\Anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py",
line 20, in swig_import_helper
return importlib.import_module('_pywrap_tensorflow_internal')
File "C:\ProgramData\Anaconda3\envs\tensorflow-gpu\lib\importlib__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_pywrap_tensorflow_internal'
Failed to load the native
TensorFlow runtime.
See https://www.tensorflow.org/install/install_sources#common_installation_problems
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
Tensorflow installation with pip did not give any errors, but I fixed my problem by installing CuDNN V6 instead of CuDNN V5.1. It appears that tensorflow V1.3.0 now uses CuDNN V6.
You have the option of installing Tensorflow with native pip on windows.
https://www.tensorflow.org/install/install_windows
You may use the python script (tensorflow_self_check.py) to check the problems during the installation.