• Register
0 votes

Problem :

Recently I have installed the tensorflow with a gpu support also with cuda toolkit v9.0 and cuDNNv7.1 and python 3.6 in the conda enviroment.

When I tried below command it is giving me following error

import tensorflow as tf
Traceback (most recent call last):
      File "C:\Users\mphil\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
        from tensorflow.python.pywrap_tensorflow_internal import *
      File "C:\Users\mphil\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in <module>
        _pywrap_tensorflow_internal = swig_import_helper()
      File "C:\Users\mphil\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in swig_import_helper
        return importlib.import_module(mname)
      File "C:\Users\mphil\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\importlib\__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
    ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.


8 4 2
2,300 points

1 Answer

0 votes

Solution :

I have gone through your problem, I had faced same problem recently and I was able to fix this by following below procedure:

The very first step which I did was to download the Miniconda from the following link https://docs.conda.io/en/latest/miniconda.html

After that I had installed the Miniconda and also tick the 'Add to Path' option.

I opened the Anaconda command prompt or the power shell and just typed 'conda' to make sure it is correctly installed

Then I typed following command 'conda activate base' to activate my base environment you can see base in front of the directory

Now I was ready to install the tensorflow so I typed 'conda install tensorflow' and waited for some time it installed tensorflow 2.0 and all of the dependencies

Then I did import tensorflow

And it started working for me!!!

5 2 1
4,980 points

Related questions

0 votes
1 answer 44 views
Problem : I am new to python. I have tried to install below softwares: Python 2.5.4, Numpy 1.5.0 win32, Matplotlib 1.0.0 win32, pywin32 218. After doing so much of hard work I am still unable to plot the graphs in Python. I am facing ... > from matplotlib._path import affine_transform ImportError: DLL load failed: The specified module could not be found. Can somebody help me in fixing this error?
asked Feb 22 mphil 2.3k points
0 votes
1 answer 90 views
Problem : I am very new to tensorflow-gpu, I want to use the tensorflow-gpu on my system. I have already tried to reinstall tensorflow-gpu many times but still it shows me the following error.If I use the tensorflow-cpu then it works correctly. Please Note: I ... ) ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory Can somebody help me in fixing above error ?
asked Feb 19 mphil 2.3k points
0 votes
2 answers 75 views
Problem : I have recently installed the cuda 8.0 and cuda 9.0 in the Gpu support system. I encountered the below error while importing from the keras module. It says it is unable to load the native tensorflow runtime. I have received the error log as below: Traceback ... is, Cuda compilation tools, release 8.0, V8.0.61 Is it the clash between two cuda versions? Have anyone solved this before?
asked Feb 18 mphil 2.3k points
0 votes
1 answer 1.3K views
Problem : I am facing following error : ImportError: libcuda.so.1: cannot open shared object file: No such file or directory Failed to load the native TensorFlow runtime. Above error comes up when I tried to import the tensorflow. Is there anybody who has faced this error before and know the solution on it?
asked Dec 10, 2019 alecxe 7.5k points
0 votes
1 answer 220 views
Problem : I am building the TensorFlow from the source code. The build appears to succeed; but, when my TensorFlow program invokes the import tensorflow, one or both of the following errors starts appearing: · ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory · ImportError: libcudnn.5: cannot open shared object file: No such file or directory
asked Dec 9, 2019 alecxe 7.5k points