Problem running Tensorflow (Ubuntu 19.10) - python-3.x

I've recently tried to install and run some python and tensorflow code from this repository.
I followed the manual installation procedure just as mentioned in the README.md present in the repository.
As I've never used tensorflow before, I had to install a lot of packages to get it up and running.
Currently, I've got tensorfow-gpu 1.13, python 3.7, and an Nvidia graphics card (mx250) on my Ubuntu 19.10 laptop, and I wish to get the code running. However, I'm having issues running the demo.sh file present with it.
Here's what I get in the err.txt when I run the command $ bash demo.sh > output.txt 2> err.txt at the cloned directory (after installing all required packages):
*** Aborted at 1575094215 (unix time) try "date -d #1575094215" if you are using GNU date ***
PC: # 0x7f92c7012ae8 ceres::internal::ProgramEvaluator<>::Evaluate()
*** SIGSEGV (#0x0) received by PID 22202 (TID 0x7f92acda5700) from PID 0; stack trace: ***
# 0x7f92c7452641 (unknown)
# 0x7f92c67dd540 (unknown)
# 0x7f92c7012ae8 ceres::internal::ProgramEvaluator<>::Evaluate()
# 0x7f92c709265f ceres::internal::TrustRegionMinimizer::EvaluateGradientAndJacobian()
# 0x7f92c7092f4a ceres::internal::TrustRegionMinimizer::IterationZero()
# 0x7f92c70972d4 ceres::internal::TrustRegionMinimizer::Minimize()
# 0x7f92c7088cbc ceres::Solver::Solve()
# 0x7f92c70899b9 ceres::Solve()
# 0x55bb3bb1a2eb colmap::BundleAdjuster::Solve()
# 0x55bb3bb78037 colmap::IncrementalMapper::AdjustGlobalBundle()
# 0x55bb3bac3f0c (unknown)
# 0x55bb3bac521d colmap::IncrementalMapperController::Reconstruct()
# 0x55bb3bac6a9b colmap::IncrementalMapperController::Run()
# 0x55bb3bbd7dfc colmap::Thread::RunFunc()
# 0x7f92c5ad9f74 (unknown)
# 0x7f92c67d1669 start_thread
# 0x7f92c578f323 clone
Traceback (most recent call last):
File "imgs2poses.py", line 11, in <module>
gen_poses(args.scenedir)
File "/home/abhigyan/Code/CVProject/LLFF/llff/poses/pose_utils.py", line 265, in gen_poses
run_colmap(basedir)
File "/home/abhigyan/Code/CVProject/LLFF/llff/poses/colmap_wrapper.py", line 70, in run_colmap
map_output = ( subprocess.check_output(mapper_args, universal_newlines=True) )
File "/home/abhigyan/anaconda3/lib/python3.7/subprocess.py", line 395, in check_output
**kwargs).stdout
File "/home/abhigyan/anaconda3/lib/python3.7/subprocess.py", line 487, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['colmap', 'mapper', '--database_path', 'data/testscene/database.db', '--image_path', 'data/testscene/images', '--output_path', 'data/testscene/sparse', '--Mapper.num_threads', '16', '--Mapper.init_min_tri_angle', '4', '--Mapper.multiple_models', '0', '--Mapper.extract_colors', '0']' died with <Signals.SIGSEGV: 11>.
Traceback (most recent call last):
File "/home/abhigyan/anaconda3/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/abhigyan/anaconda3/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/abhigyan/anaconda3/lib/python3.7/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 "/home/abhigyan/anaconda3/lib/python3.7/imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "/home/abhigyan/anaconda3/lib/python3.7/imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "imgs2mpis.py", line 10, in <module>
from llff.inference.mpi_utils import run_inference
File "/home/abhigyan/Code/CVProject/LLFF/llff/inference/mpi_utils.py", line 6, in <module>
from llff.inference.mpi_tester import DeepIBR
File "/home/abhigyan/Code/CVProject/LLFF/llff/inference/mpi_tester.py", line 1, in <module>
import tensorflow as tf
File "/home/abhigyan/anaconda3/lib/python3.7/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "/home/abhigyan/anaconda3/lib/python3.7/site-packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/abhigyan/anaconda3/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/home/abhigyan/anaconda3/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/abhigyan/anaconda3/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/abhigyan/anaconda3/lib/python3.7/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 "/home/abhigyan/anaconda3/lib/python3.7/imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "/home/abhigyan/anaconda3/lib/python3.7/imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory
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.
mkdir: cannot create directory ‘data/testscene/outputs/’: File exists
Traceback (most recent call last):
File "imgs2renderpath.py", line 34, in <module>
poses, bds = load_data(args.scenedir, load_imgs=False)
File "/home/abhigyan/Code/CVProject/LLFF/llff/poses/pose_utils.py", line 195, in load_data
poses_arr = np.load(os.path.join(basedir, 'poses_bounds.npy'))
File "/home/abhigyan/anaconda3/lib/python3.7/site-packages/numpy/lib/npyio.py", line 428, in load
fid = open(os_fspath(file), "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'data/testscene/poses_bounds.npy'
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
demo.sh: line 24: 22221 Aborted (core dumped) cuda_renderer/cuda_renderer data/testscene/mpis_360 data/testscene/outputs/test_path.txt data/testscene/outputs/test_vid.mp4 360 .8 18

When you are going to use Tensorflow in GPU setup, have to carefully install and configure the Tensorflow in your machine. I would like to prefer to use Ubuntu 18.04 LTS version instead of 19.xx.
Follow the installation steps from the blog: https://zhuanlan.zhihu.com/p/49166211

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

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

why i am getting error for "import tensorflow" in ubuntu even after installing everything for running tensorflow in gpu

Traceback (most recent call last):
File "/home/harsh/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/harsh/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/harsh/anaconda3/lib/python3.6/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 "/home/harsh/anaconda3/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/home/harsh/anaconda3/lib/python3.6/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File "/home/harsh/anaconda3/lib/python3.6/site-packages/tensorflow/init.py", line 28, in
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "/home/harsh/anaconda3/lib/python3.6/site-packages/tensorflow/python/init.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "/home/harsh/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/home/harsh/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/harsh/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/harsh/anaconda3/lib/python3.6/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 "/home/harsh/anaconda3/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/home/harsh/anaconda3/lib/python3.6/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
Tensorflow 1.13 recently got released and requires now CUDA 10
I installed CUDA according this tutorial https://www.tensorflow.org/install/gpu and got the same issue as the tutorial is still for CUDA 9.
It helped me to install previous version of tf 1.12:
pip3 install tensorflow==1.12
pip3 install tensorflow-gpu==1.12

having trouble install tensorflow

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.
>>>

Resources