Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Win10: ImportError: DLL load failed: The specified module could not be found #22794

Closed
damcclane opened this issue Oct 6, 2018 · 184 comments
Closed
Assignees
Labels
subtype:windows Windows Build/Installation Issues type:build/install Build and install issues

Comments

@damcclane
Copy link

damcclane commented Oct 6, 2018

System information:

Have I written custom code: No
OS Platform and Distribution: Windows 10 Pro updated
Mobile device: None
TensorFlow installed from: pip install
TensorFlow version: 1.11.0
Python Version: 3.6.6
Bazel version: not installed
CUDA/cuDNN version: CUDA 9.0, cuDNN 8.0
GPU model and memory: GF-GTX970 STRIX
Exact command to reproduce:
pip install tensorflow
pip install tensorflow-gpu
python
import tensorflow as tf

Problem

I have had this error consistently even after trying to downgrade to older versions of CUDA tool, cuDNN, python, tensorflow and tensorflow-gpu. I have updated my enviornment variables. I have installed Visual C++ Redistributable Update.
I have read and tried to follow the solutions from other similar issues (such as #10033 and #17101), but have not succeeded in fixing the problem.

Log

C:\Users\user>python
Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 03:37:03) [MSC v.1900 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\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\user\AppData\Local\Programs\Python\Python36\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\user\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\user\AppData\Local\Programs\Python\Python36\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 "", line 1, in
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_init_.py", line 22, in
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python_init_.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\user\AppData\Local\Programs\Python\Python36\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\user\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.

@tensorflowbutler tensorflowbutler added the stat:awaiting response Status - Awaiting response from author label Oct 6, 2018
@tensorflowbutler
Copy link
Member

Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks.
Mobile device

@damcclane
Copy link
Author

Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks.
Mobile device

Ok done.

@kennedyCzar
Copy link

I had the same issue while trying to use tensorflow-gpu on windows 10.
Since i couldn't get it to work on cuDNN10..i opted for 9 instead using...

conda create --name tf-gpu
conda install -c aaronzs tensorflow-gpu
conda install -c anaconda cudatoolkit
conda install -c anaconda cudnn
conda install keras-gpu

you can also check the fullpost on https://www.pugetsystems.com/labs/hpc/The-Best-Way-to-Install-TensorFlow-with-GPU-Support-on-Windows-10-Without-Installing-CUDA-1187/

Credit to Dr Donald Kinghorn

@tensorflowbutler tensorflowbutler removed the stat:awaiting response Status - Awaiting response from author label Oct 7, 2018
@umitkilic
Copy link

umitkilic commented Oct 15, 2018

I have same problem with you @damcclane . How did you solve ?

Win10 x64, python 3.6, cuda9 with cudnn 7.0.5 and also Win10 x64, python 3.7, cuda10 with cudnn 7.3.1

Both has the same problem. My graphic card is Nvidia GeForce 1050 Ti

@CorentinJ
Copy link

Same issue. Win10 x64, python 3.5, tensorflow-gpu 1.11.0, CUDA 8 with CUDNN 6 installed.

@starcream
Copy link

Same problem,Win10 x64,python 3.6 ,cuda 9 with cudnn 7.0

@henry-huynh-3508
Copy link

Same problem, anyone knows how to solve this?

@tcllst
Copy link

tcllst commented Oct 17, 2018

Same problem here… :(

@CorentinJ
Copy link

I've had this issue in the past and it was because I had the wrong version of CUDNN. You could try downloading a few of them and see if any of those work.

@ymodak
Copy link
Contributor

ymodak commented Oct 17, 2018

I would like to encourage all who are facing this issue to create a new issue on TensorFlow repo so that we can focus on solving your problem on individual basis since the system config can vary from person to person. Thanks!

@tcllst
Copy link

tcllst commented Oct 17, 2018 via email

@umitkilic
Copy link

I installed CUDA9 and cuDNN 7.0.5 again and restarted the computer. The related problem has just gone.

@Darshu1315
Copy link

I am using Cuda10 and cudaNN 7.3.1.20 and i got the following error can someone tell the solution @tensorflowbutler
Traceback (most recent call last):
File "C:\Users\Darshan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Darshan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Darshan\AppData\Local\Programs\Python\Python36\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\Darshan\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\Darshan\AppData\Local\Programs\Python\Python36\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 "", line 1, in
File "C:\Users\Darshan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_init_.py", line 22, in
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Users\Darshan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python_init_.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "C:\Users\Darshan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\Darshan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Darshan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Darshan\AppData\Local\Programs\Python\Python36\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\Darshan\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\Darshan\AppData\Local\Programs\Python\Python36\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.

@iteratorlee
Copy link

Same issue, Windows 10 x64, python3.5, tensorflow-gpu 1.11.0, CUDA 10.0, cudnn 7.3.1, my graphics card is GTX 1070Ti

@ymodak
Copy link
Contributor

ymodak commented Oct 24, 2018

@iteratorlee

I would like to encourage all who are facing this issue to create a new issue on TensorFlow repo so that we can focus on solving your problem on individual basis since the system config can vary from person to person. Thanks!

@catruck
Copy link

catruck commented Oct 24, 2018

Same problem, on cuda 10, when I install anaconda I have missed the PyHamcrest, after I install "pip install PyHamcrest" all worked fine until today. I get the same error.

@mragon2
Copy link

mragon2 commented Oct 27, 2018

I am facing the same issues. The problem appears also in importing another package named PyQSTEM for electron microscopy simulation. If someone can find a way to fix the problem, could please share here the solution? Thanks

@BirdeeChen
Copy link

Same issue, Windows 10 x64, python3.5, tensorflow-gpu 1.11.0, CUDA 10.0, cudnn 7.3.1, my graphics card is GTX 1070Ti

Same issue, and I tried to install CUDA 9.0, but NVIDIA inform me the driver is not compatible graphic hardware, but with CUDA 10.0, there is no such warning.

@BirdeeChen
Copy link

Lucky, Issue solved when getting visual studio 2017 with C++ package installed, Windows 10 x64, python3.6.7, tensorflow-gpu 1.11.0, cudnn 7.3.1, both cuda 9.0 & cuda 10.0 installed(not checking which is the right one), my graphics card is GTX 1070Ti.

@WuYunfan
Copy link

I finally solve the problem by installing cuda 9.0 instead of 9.2 or 10.0 with tensorflow 1.12.0 and cudnn 7.4.1.5

@boldt
Copy link

boldt commented Nov 14, 2018

I can confirm, that the following assembly does not work on Windows 10:

  • tensorflow 1.12.0
  • cuda toolkit 10.0.130
  • cudnn 7.4.1.5

Additional infos:

  • NVIDIA Quadro P1000 with NVIDIA driver 411.81
  • Microsoft Visual C++ 2015 Redistributable 14.0.24215 (C:\Windows\system32\msvcp140.dll exists)
  • Python 3.6.7

I also get the message

ImportError: DLL load failed: The specified module could not be found.

Unfortunately, it does not say which module is missed.

[EDIT]

Just realized, that you write:

TensorFlow supports CUDA 9.0.

I'll reinstall now.

@sssmayank
Copy link

Traceback (most recent call last):
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Program Files\Python36\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:\Program Files\Python36\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Program Files\Python36\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: %1 is not a valid Win32 application.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\ABC\Desktop\pyprograms\tensorflowbasic\1.py", line 1, in
import tensorflow as tf
File "C:\Program Files\Python36\lib\site-packages\tensorflow_init_.py", line 24, in
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python_init_.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Program Files\Python36\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:\Program Files\Python36\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Program Files\Python36\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: %1 is not a valid Win32 application.

@levicki
Copy link

levicki commented Nov 25, 2018

My install:

Windows 10.0.17763.134 x64
NVIDIA Driver 416.92
CUDA 10.0.130
CUDNN 7.4.1.5 for CUDA 10.0
Python 3.6.7
GeForce GTX 1080 Ti

The cause of this error seems to be people installing Python without Tcl/Tk support not realizing that Tcl is necessary for SWIG and module imports. I just tested this and in my case it was not enough to modify the Python installation to add Tcl/Tk -- I had to delete everything and install from scratch and now I am not getting the error anymore.

TL;DR -- just fully remove and reinstall Python with Tcl/Tk option selected.

@sulaimanvesal
Copy link

sulaimanvesal commented Nov 27, 2018

After spending almost two days, I finally solved the problem by installing:

  • cuda 9.0 instead of 9.2 or 10.0
  • tensorflow1.12.0
  • cudnn 7.4.1.5

Thanks to @WuYunfan 💯

@wedesoft
Copy link

wedesoft commented Jan 9, 2020

Had this issue with Tensorflow 2.1.0 (CPU version). Managed to fix it by downgrading to Tensorflow 2.0.0:

pip install tensorflow==2.0.0

@abdulrahman-khankan
Copy link

abdulrahman-khankan commented Jan 11, 2020

If you are having this after 2.1.0, it is probably because it comes with GPU support by default. And it requires Microsoft Visual C++ Redistributable for Visual Studio 2015 as shown in the installation step #1 on the website.

image

From the release notes:

image

@rgov
Copy link

rgov commented Jan 12, 2020

I found the release notes that @abdulrahman-khankan screenshot'd above: https://github.com/tensorflow/tensorflow/releases/tag/v2.1.0

Here is the Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 link from that document. Remember, text in screenshots can't be clicked, copied, translated, read by screen readers, etc.!

@abdulrahman-khankan
Copy link

I assumed everyone knows how to go to the releases page or just google the MS installers. Thanks for sharing the links!

@wedesoft
Copy link

Because of further issues with PyInstaller I ended up downgrading to tensorflow == 1.14.0.

@juskuz
Copy link

juskuz commented Jan 17, 2020

@ERDataDoc using your link

The easy button is to follow the instructions in this post:
https://www.pugetsystems.com/labs/hpc/How-to-Install-TensorFlow-with-GPU-Support-on-Windows-10-Without-Installing-CUDA-UPDATED-1419

is helpful but sometimes it can upgrade the driver to CUDA 10.2 which is not supported yet
(that happened in my case)

@BigIan1969
Copy link

Sorry I realize this isn't helpful but I've now given up trying to do anything serious with Python under Windows. 3 Weeks in and I'm still trying to install all the shit I need for the first tutorial (Maybe I set my sights too high but then I do remember punch cards and paper tape)

@Lem0nRavioli
Copy link

Lem0nRavioli commented Jan 28, 2020

#22512 (comment)
This solved it for me.
(Downgrading to tensorflow 2.0.0)
pip install tensorflow==2.0.0

@Ansreng360
Copy link

Ansreng360 commented Jan 30, 2020

#22794 (comment)

I installed the redistributable and msvcp140.dll is available on my file system.

However, I still get the error. Downgrading helps, but I need to upgrade my version, since there is an unfixed bug on 2.0.0 I can't get around.

Is there any notice from the developers, that they are working on this?

@ajmalfaiz
Copy link

I fixed it.
Spend days searching to fix them.

Installed tensorflow with pip install tensorflow-cpu
Updated visual c++ 2015-2019

issue was because i didn't had nvidia graphics so that i should install with cpu version because i am using Raedon vega 8 graphics

Hope it helps.

@lucasgouvea
Copy link

In my case, I was using Python 3.6 and it was erroring. So I upgraded to 3.6.8 and it then worked with tensorflow 2.0.0

@zayedrais
Copy link

It's work for me python: 3.7.6
pip install tensorflow==2.0
if you are using tensoflow-gpu
pip install --upgrade tensorflow-gpu==2.0

@KoenDelaere
Copy link

KoenDelaere commented Feb 7, 2020

I installed

  • python 3.6.2 (<-- had to change my python version, and change to 64bit)
  • I already had the msvcp140.dll and msvcp140_1.dll in my System32/
  • Cuda 10.0 (not sure if that was necessary).
  • pip install tensorflow==2.0 (<-- 2.1.0 did not work!)
    and then it worked :)

@mihaimaruseac
Copy link
Collaborator

This is the final answer on this thread: #22794 (comment)

Please don't spam with "I solved it!" and custom solutions.

@YaroslavBerko
Copy link

Hi, @mihaimaruseac

  1. Can you add new item with a description of the problems that may be cause by the lack of support for AVX command to the instruction on the site?
  2. Сan you add this link to the problem list where Error message is equal "ImportError: DLL load failed: The specified module could not be found."
  3. Do you know how to create own binaries that will be without AVX support?

If some one need tensorflow whl without AVX support you can find it in this repository, many thanks to the author. Or you can use Intel Software Development Emulator to run original tensorflow with AVX support.

To test AVX support use Coreinfo.

@PANKAJ1802
Copy link

ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.

Traceback (most recent call last):
File "C:\Users\Pankaj\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3331, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
flair_data, ot_data =load_dataset(PATH)
File "", line 64, in load_dataset
train_ot = np.vstack(train_ot)
File "<array_function internals>", line 6, in vstack
File "C:\Users\Pankaj\Anaconda3\lib\site-packages\numpy\core\shape_base.py", line 283, in vstack
return _nx.concatenate(arrs, 0)
File "<array_function internals>", line 6, in concatenate
ValueError: need at least one array to concatenate

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Pankaj\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2044, in showtraceback
stb = value.render_traceback()
AttributeError: 'ValueError' object has no attribute 'render_traceback'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Pankaj\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Pankaj\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Pankaj\Anaconda3\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\Pankaj\Anaconda3\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\Pankaj\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\Pankaj\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 1151, in get_records
return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset)
File "C:\Users\Pankaj\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 319, in wrapped
return f(*args, **kwargs)
File "C:\Users\Pankaj\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 353, in fixed_getinnerframes
records = fix_frame_records_filenames(inspect.getinnerframes(etb, context))
File "C:\Users\Pankaj\Anaconda3\lib\inspect.py", line 1502, in getinnerframes
frameinfo = (tb.tb_frame,) + getframeinfo(tb, context)
File "C:\Users\Pankaj\Anaconda3\lib\inspect.py", line 1460, in getframeinfo
filename = getsourcefile(frame) or getfile(frame)
File "C:\Users\Pankaj\Anaconda3\lib\inspect.py", line 696, in getsourcefile
if getattr(getmodule(object, filename), 'loader', None) is not None:
File "C:\Users\Pankaj\Anaconda3\lib\inspect.py", line 733, in getmodule
if ismodule(module) and hasattr(module, 'file'):
File "C:\Users\Pankaj\Anaconda3\lib\site-packages\tensorflow_init
.py", line 50, in getattr
module = self.load()
File "C:\Users\Pankaj\Anaconda3\lib\site-packages\tensorflow_init
.py", line 44, in _load
module = importlib.import_module(self.name)
File "C:\Users\Pankaj\Anaconda3\lib\importlib_init
.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 953, in _find_and_load_unlocked
File "", line 219, in _call_with_frames_removed
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in call_with_frames_removed
File "C:\Users\Pankaj\Anaconda3\lib\site-packages\tensorflow_core_init
.py", line 42, in
from . api.v2 import audio
File "C:\Users\Pankaj\Anaconda3\lib\site-packages\tensorflow_core_api\v2\audio_init
.py", line 10, in
from tensorflow.python.ops.gen_audio_ops import decode_wav
File "C:\Users\Pankaj\Anaconda3\lib\site-packages\tensorflow_core\python\ops\gen_audio_ops.py", line 9, in
from tensorflow.python import pywrap_tensorflow as pywrap_tensorflow
File "C:\Users\Pankaj\Anaconda3\lib\site-packages\tensorflow_init
.py", line 50, in getattr
module = self.load()
File "C:\Users\Pankaj\Anaconda3\lib\site-packages\tensorflow_init
.py", line 44, in _load
module = importlib.import_module(self.name)
File "C:\Users\Pankaj\Anaconda3\lib\importlib_init
.py", line 127, in import_module
return _bootstrap.gcd_import(name[level:], package, level)
File "C:\Users\Pankaj\Anaconda3\lib\site-packages\tensorflow_core\python_init
.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "C:\Users\Pankaj\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\Pankaj\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3331, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
flair_data, ot_data =load_dataset(PATH)
File "", line 64, in load_dataset
train_ot = np.vstack(train_ot)
File "<array_function internals>", line 6, in vstack
File "C:\Users\Pankaj\Anaconda3\lib\site-packages\numpy\core\shape_base.py", line 283, in vstack
return _nx.concatenate(arrs, 0)
File "<array_function internals>", line 6, in concatenate
ValueError: need at least one array to concatenate

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Pankaj\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2044, in showtraceback
stb = value.render_traceback()
AttributeError: 'ValueError' object has no attribute 'render_traceback'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Pankaj\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Pankaj\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Pankaj\Anaconda3\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\Pankaj\Anaconda3\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\Pankaj\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.

@fitrialif
Copy link

please uninstall the latest Microsoft Visual C++ Redistributable for Visual Studio version if you install 2019 and before that

download Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 depending on your system either x64 or x86 on this website

https://support.microsoft.com/en-my/help/2977003/the-latest-supported-visual-c-downloads

@TristanTTran
Copy link

please uninstall the latest Microsoft Visual C++ Redistributable for Visual Studio version if you install 2019 and before that

download Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 depending on your system either x64 or x86 on this website

https://support.microsoft.com/en-my/help/2977003/the-latest-supported-visual-c-downloads

Hi fitrialif,
I did install that Micrsoft Visual C++. But the same error persists. After installing that, is there anything else I should do (moving files around,etc?)

@pallyndr
Copy link

pallyndr commented Mar 3, 2020

Seems to be a problem with TF2.1.

Downgrading to TF2.0 worked for me: pip install tensorflow==2.0

@mihaimaruseac
Copy link
Collaborator

@pallyndr this is because you need to download the newest MSVC redistributable for 2.1 as mentioned in #22794 (comment)

Unfortunately as people keep piling on the thread with "it works for me"/"I'm having the same issue"/"solved it by doing this other thing", the actual solution in the above comment got burried.

@PabloLION
Copy link

after I download MSVC and CUDA (I am with NVIDIA card) and cuDNN it worked.

@mihaimaruseac
Copy link
Collaborator

Locking conversation to not get more comments that mute the solution

@tensorflow tensorflow locked as resolved and limited conversation to collaborators Mar 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
subtype:windows Windows Build/Installation Issues type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests