TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 icon indicating copy to clipboard operation
TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 copied to clipboard

ImportError: DLL load failed:

Open HimathHarshajith opened this issue 7 years ago • 5 comments

I have got this error when after running this code "python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config"

Can anyone suggest a solution for this.

C:\tensorflow1\models\research\object_detection>python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config Traceback (most recent call last): File "C:\Users\Thisath\Anaconda3\envs\hima\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\Thisath\Anaconda3\envs\hima\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\Thisath\Anaconda3\envs\hima\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\Thisath\Anaconda3\envs\hima\lib\imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "C:\Users\Thisath\Anaconda3\envs\hima\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 "train.py", line 47, in import tensorflow as tf File "C:\Users\Thisath\Anaconda3\envs\hima\lib\site-packages\tensorflow_init_.py", line 24, in from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import File "C:\Users\Thisath\Anaconda3\envs\hima\lib\site-packages\tensorflow\python_init_.py", line 49, in from tensorflow.python import pywrap_tensorflow File "C:\Users\Thisath\Anaconda3\envs\hima\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in raise ImportError(msg) ImportError: Traceback (most recent call last): File "C:\Users\Thisath\Anaconda3\envs\hima\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\Thisath\Anaconda3\envs\hima\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\Thisath\Anaconda3\envs\hima\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\Thisath\Anaconda3\envs\hima\lib\imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "C:\Users\Thisath\Anaconda3\envs\hima\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.

HimathHarshajith avatar Apr 09 '19 13:04 HimathHarshajith

SAMe here ! anyone can Help!!!

786Hasnain avatar Apr 21 '19 15:04 786Hasnain

SAMe here ! anyone can Help!!!

I've solved it by reinstall correctly the CUDA and CUDNN.Also installed Visual C++ by using visual studio.

HimathHarshajith avatar May 02 '19 16:05 HimathHarshajith

We struggled with this DLL error for days, until we finally deleted and reinstalled Anaconda and just ran

conda install tensorflow-gpu

after setting up the virtual environment (conda create --name tf_gpu).

It apparently downloaded cudatoolkit and cudnn again via conda installer and suddenly everything worked!

freefallr avatar May 10 '19 18:05 freefallr

@Freefallr thanks man!

I was running into the same DLL issues and couldn't get it figured out. You're right, deleting and re-installing Anaconda and then using conda install tensorflow-gpu (rather than pip install tensorflow-gpu) solves the problem.

For others: when you use the "conda install tensorflow-gpu" command, it will automatically download the appropriate versions of TensorFlow, CUDA and cuDNN. If you are having issues with DLL errors, I recommend following the fix suggested by @Freefallr .

EdjeElectronics avatar Jun 22 '19 05:06 EdjeElectronics