having trouble install tensorflow - python-3.x

So I am learning deep learning. For convolutional neural networks purpose I need tensorflow. I installed tensorflow and several packages with the following command:
conda create -n tensorflow python=3.5
source activate tensorflow
conda install pandas matplotlib jupyter notebook scipy scikit-learn
pip install tensorflow
but then when I tried to run this it failed:
# Python
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
anyone knows what went wrong thanks?
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 61, in <module>
from tensorflow.python import pywrap_tensorflow
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow.so, 10): Library not loaded: #rpath/libcudart.8.0.dylib
Referenced from: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow.so
Reason: image not found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/yiransi/Documents/tensorflowtest.py", line 3, in <module>
import tensorflow as tf
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 72, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 61, in <module>
from tensorflow.python import pywrap_tensorflow
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow.so, 10): Library not loaded: #rpath/libcudart.8.0.dylib
Referenced from: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow.so
Reason: image not found
Failed to load the native TensorFlow runtime.
See https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_started/os_setup.md#import_error
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
>>>

Related

ERROR: Could not install packages due to an EnvironmentError while installing tensorflow

I am trying to follow along with the AI tutorial here: https://www.youtube.com/watch?v=WFr2WgN9_xE
but at 11:56 when he runs the program, I get this error:
Traceback (most recent call last):
File "C:\Users\Joshua\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Joshua\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Joshua\anaconda3\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\Joshua\anaconda3\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\Joshua\anaconda3\lib\imp.py", line 342, in load_dynamic
return _load(spec)
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:/Users/Joshua/PycharmProjects/ tensorEnv/test.py", line 1, in <module>
import tensorflow
File "C:\Users\Joshua\anaconda3\lib\site-packages\tensorflow\__init__.py", line 41, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\Joshua\anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 50, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\Joshua\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 69, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\Joshua\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Joshua\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Joshua\anaconda3\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\Joshua\anaconda3\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\Joshua\anaconda3\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
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.
I tried re-installing tensorflow with pip install tensorflow, but I get this error:
ERROR: Could not install packages due to an EnvironmentError:
[Errno 2] No such file or directory: 'C:\\Users\\Joshu
a\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python37
\\site-packages\\tensorboard_plugin_wit\\_vendor\\tensorflow_serving\\sources\\storage_path\\__pycache__\\file_syste
m_storage_path_source_pb2.cpython-37.pyc'
does anybody know how to fix this?
I fixed it! I installed an older version of tensorflow with pip install tensorflow==1.15.2. Credit to #Micheal Chen for showing me a link to a similar issue

py3.7 TensorFlow The specified module could not be found

As above, I have a problem importing tensorflow.
Here is the output with the IDLE:
Python 3.7.6 (tags/v3.7.6:43364a7ae0, Dec 19 2019, 00:42:30) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> import tensorflow as tf
Traceback (most recent call last):
File "C:\Users\sungn_000\AppData\Local\Programs\Python\Python37\lib\site-packa
ges\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\sungn_000\AppData\Local\Programs\Python\Python37\lib\site-packa
ges\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\sungn_000\AppData\Local\Programs\Python\Python37\lib\site-packa
ges\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:\Users\sungn_000\AppData\Local\Programs\Python\Python37\lib\imp.py", l
ine 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\sungn_000\AppData\Local\Programs\Python\Python37\lib\imp.py", l
ine 342, in load_dynamic
return _load(spec)
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 "<pyshell#0>", line 1, in <module>
import tensorflow as tf
File "C:\Users\sungn_000\AppData\Local\Programs\Python\Python37\lib\site-packa
ges\tensorflow\__init__.py", line 101, in <module>
from tensorflow_core import *
File "C:\Users\sungn_000\AppData\Local\Programs\Python\Python37\lib\site-packa
ges\tensorflow_core\__init__.py", line 40, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\sungn_000\AppData\Local\Programs\Python\Python37\lib\site-packa
ges\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "C:\Users\sungn_000\AppData\Local\Programs\Python\Python37\lib\site-packa
ges\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "C:\Users\sungn_000\AppData\Local\Programs\Python\Python37\lib\importlib\__init__.py", line 1
27, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\sungn_000\AppData\Local\Programs\Python\Python37\lib\site-packa
ges\tensorflow_core\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\sungn_000\AppData\Local\Programs\Python\Python37\lib\site-packa
ges\tensorflow_core\python\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\sungn_000\AppData\Local\Programs\Python\Python37\lib\site-packa
ges\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\sungn_000\AppData\Local\Programs\Python\Python37\lib\site-packa
ges\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\sungn_000\AppData\Local\Programs\Python\Python37\lib\site-packa
ges\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:\Users\sungn_000\AppData\Local\Programs\Python\Python37\lib\imp.py", line 2
42, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\sungn_000\AppData\Local\Programs\Python\Python37\lib\imp.py", line 3
42, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
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.
I'm using Windows 8.1 64-bit, Python 3.7. Installed tensorflow 2.1.0 with pip install tensorflow.
Saw some GitHub issues and some Stack Overflow questions, but none of them fixed the issue.
Didn't install CUDA or something else. Is this effective with this?
What is wrong with this??
EDIT Sorry, installed Tensorflow with Anaconda (latest). Made an enviroment in it.
**
You Need To setup first Virtual Environment for Tensorflow
**
then
pip install --upgrade tensorflow
after install please Verify the install:
python -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"

ImportError: DLL load failed: The specified module could not be found. When trying to import tensorflow and keras into PyCharm

I have been trying to install and use tensorflow for the past week and I encountered a problem when importing it along with keras in PyCharm.
CPU:Intel(R) Core(TM) i7-7820HQ CPU # 2.90GHz
GPU:Intel(R) HD Graphics 630
This is what I put in the file:
import tensorflow
import keras
This is what appears in the PyCharm terminal when I run:
Traceback (most recent call last):
File "C:\Users\Bob\Anaconda3\envs\tensor\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Bob\Anaconda3\envs\tensor\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Bob\Anaconda3\envs\tensor\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:\Users\Bob\Anaconda3\envs\tensor\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\Bob\Anaconda3\envs\tensor\lib\imp.py", line 343, in load_dynamic
return _load(spec)
**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:/Users/Bob/PycharmProjects/tensorenv/test.py", line 1, in <module>
import tensorflow
File "C:\Users\Bob\Anaconda3\envs\tensor\lib\site-packages\tensorflow\__init__.py", line 101, in <module>
from tensorflow_core import *
File "C:\Users\Bob\Anaconda3\envs\tensor\lib\site-packages\tensorflow_core\__init__.py", line 40, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\Bob\Anaconda3\envs\tensor\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "C:\Users\Bob\Anaconda3\envs\tensor\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "C:\Users\Bob\Anaconda3\envs\tensor\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\Bob\Anaconda3\envs\tensor\lib\site-packages\tensorflow_core\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\Bob\Anaconda3\envs\tensor\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\Bob\Anaconda3\envs\tensor\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Bob\Anaconda3\envs\tensor\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Bob\Anaconda3\envs\tensor\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:\Users\Bob\Anaconda3\envs\tensor\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\Bob\Anaconda3\envs\tensor\lib\imp.py", line 343, in load_dynamic
return _load(spec)
**ImportError: DLL load failed: The specified module could not be found.**
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.
Process finished with exit code 1
I have looked up these install errors with the link they provide, but all of the answers I tried either do not work or do not apply.
Thanks.
ImportError: DLL load failed issue is not with, how you have imported Keras and tensorflow ?
common solution for this is, you need to install/update Microsoft Visual C++ 2015-2019 Redistributable (x64) from here.
I have answered possible other reasons and compatible configurations (i.e Tensorflow, Python, etc. version details) for windows operating system in another Stackoverflow question here. Hope this will resolve your problem.

Tensor Flow issues with Python

Still struggling to get that GPT-2 Tutorial working. I Am now back to having issues with Tensor Flow. Note I'm on a Completely clean install of Windows 10 (x64) on a Lenovo Thinkpad.
Getting the following error whenever I try to train GPT-2:
Traceback (most recent call last):
File "C:\Users\Ian\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Ian\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Ian\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\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:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\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 "encode.py", line 10, in <module>
from load_dataset import load_dataset
File "C:\PY\gpt-2-finetuning\src\load_dataset.py", line 4, in <module>
import tensorflow as tf
File "C:\Users\Ian\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow\__init__.py", line 98, in <module>
from tensorflow_core import *
File "C:\Users\Ian\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow_core\__init__.py", line 40, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\Ian\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "C:\Users\Ian\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\Ian\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow_core\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\Ian\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\Ian\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Ian\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Ian\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\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:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.
Any thoughts?
Welcome to the world of tensorflow I/O. I've seen similar errors and most likely they are related to the different version compatibility issues among tensorflow, cuda, cudnn, etc. Most likely you will have to re-install the tensorflow packages with a different version. Try this workaround solution in the link below. (jump to comment by TamirisCrepalde). She basically uninstalled tensorflow and then reinstalled it using conda install.
https://github.com/tensorflow/tensorflow/issues/23683

keras and tensorflow are not running on gpu in centos 7

I have been trying to run a NN in keras using tf as backend in a centos 7 server but I got this error:
Using Theano backend.
WARNING (theano.configdefaults): install mkl with `conda install mkl-service`: No module named 'mkl'
Traceback (most recent call last):
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/configparser.py", line 1135, in _unify_values
sectiondict = self._sections[section]
KeyError: 'blas'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/configparser.py", line 168, in fetch_val_for_key
return theano_cfg.get(section, option)
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/configparser.py", line 778, in get
d = self._unify_values(section, vars)
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/configparser.py", line 1138, in _unify_values
raise NoSectionError(section)
configparser.NoSectionError: No section: 'blas'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/configparser.py", line 328, in __get__
delete_key=delete_key)
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/configparser.py", line 172, in fetch_val_for_key
raise KeyError(key)
KeyError: 'blas.ldflags'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/configdefaults.py", line 1250, in check_mkl_openmp
import mkl
ImportError: No module named 'mkl'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "ffnnecodata2.py", line 1, in <module>
from keras.layers import Input, Dense, LSTM, Activation, Dropout, Reshape
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/keras/__init__.py", line 3, in <module>
from . import utils
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/keras/utils/__init__.py", line 6, in <module>
from . import conv_utils
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/keras/utils/conv_utils.py", line 9, in <module>
from .. import backend as K
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/keras/backend/__init__.py", line 81, in <module>
from .theano_backend import *
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/keras/backend/theano_backend.py", line 7, in <module>
import theano
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/__init__.py", line 124, in <module>
from theano.scan_module import (scan, map, reduce, foldl, foldr, clone,
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/scan_module/__init__.py", line 41, in <module>
from theano.scan_module import scan_opt
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/scan_module/scan_opt.py", line 60, in <module>
from theano import tensor, scalar
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/tensor/__init__.py", line 17, in <module>
from theano.tensor import blas
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/tensor/blas.py", line 155, in <module>
from theano.tensor.blas_headers import blas_header_text
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/tensor/blas_headers.py", line 987, in <module>
if not config.blas.ldflags:
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/configparser.py", line 332, in __get__
val_str = self.default()
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/configdefaults.py", line 1447, in default_blas_ldflags
check_mkl_openmp()
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/configdefaults.py", line 1262, in check_mkl_openmp
""")
RuntimeError:
Could not import 'mkl'. Either install mkl-service with conda or set
MKL_THREADING_LAYER=GNU in your environment for MKL 2018.
If you have MKL 2017 install and are not in a conda environment you
can set the Theano flag blas.check_openmp to False. Be warned that if
you set this flag and don't set the appropriate environment or make
sure you have the right version you *will* get wrong results.
I'm using a conda environment and I tried to install mkl=2017 but it did not work.
I decided to translate my code to tensorflow and tried to run it again, but I got this message now:
Traceback (most recent call last):
File "tensorffnnecodata.py", line 17, in <module>
import tensorflow as tf
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/tensorflow/__init
.py", line 24, in <module>
from tensorflow.python import * # pylint: disable=redefined-builtin
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/tensorflow/python
_init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/tensorflow/python
ywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/tensorflow/python
ywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/tensorflow/python
ywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/tensorflow/python
ywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/imp.py", line 243, in load_modu
return load_dynamic(name, filename, file)
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/imp.py", line 343, in load_dyna
c
return _load(spec)
ImportError: libcudnn.so.7: cannot open shared object file: No such file or directory
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.
Do you know what is wrong with my installation?
The error suggests that you need to install cuDNN 7.0 (https://developer.nvidia.com/cudnn) for the version of Cuda you have installed from nVidia website and copy over the files to your Cuda installation folder. Prebuilt binaries of Tensorflow 1.7.0+ requires CUDA 9.0
ImportError: libcudnn.so.7: cannot open shared object file: No such file or directory

Resources