Error in Keras notebook 2018


(Kanaad Pathak) #1

Hey guys,

In the 2018 version of the course, In the third lesson , I keep getting this error while running the third cell.
I have setup cuDNN v7.1.4 for CUDA 9.0.
I’m running Tensorflow version 1.5.0 (I’ve also tried with the latest 1.8.0)
I’ve installed Keras using pip. And all this in a separate environment than the fastai one.

‘’’
ImportError Traceback (most recent call last)
~\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in swig_import_helper()
17 try:
—> 18 return importlib.import_module(mname)
19 except ImportError:

~\Anaconda3\lib\importlib_init_.py in import_module(name, package)
125 level += 1
–> 126 return _bootstrap._gcd_import(name[level:], package, level)
127

~\Anaconda3\lib\importlib_bootstrap.py in _gcd_import(name, package, level)

~\Anaconda3\lib\importlib_bootstrap.py in find_and_load(name, import)

~\Anaconda3\lib\importlib_bootstrap.py in find_and_load_unlocked(name, import)

~\Anaconda3\lib\importlib_bootstrap.py in _load_unlocked(spec)

~\Anaconda3\lib\importlib_bootstrap.py in module_from_spec(spec)

~\Anaconda3\lib\importlib_bootstrap_external.py in create_module(self, spec)

~\Anaconda3\lib\importlib_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)

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

During handling of the above exception, another exception occurred:

ModuleNotFoundError Traceback (most recent call last)
~\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in ()
40 sys.setdlopenflags(_default_dlopen_flags | ctypes.RTLD_GLOBAL)
—> 41 from tensorflow.python.pywrap_tensorflow_internal import *
42 from tensorflow.python.pywrap_tensorflow_internal import version

~\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in ()
20 return importlib.import_module(’_pywrap_tensorflow_internal’)
—> 21 _pywrap_tensorflow_internal = swig_import_helper()
22 del swig_import_helper

~\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in swig_import_helper()
19 except ImportError:
—> 20 return importlib.import_module(’_pywrap_tensorflow_internal’)
21 _pywrap_tensorflow_internal = swig_import_helper()

~\Anaconda3\lib\importlib_init_.py in import_module(name, package)
125 level += 1
–> 126 return _bootstrap._gcd_import(name[level:], package, level)
127

ModuleNotFoundError: No module named ‘_pywrap_tensorflow_internal’

During handling of the above exception, another exception occurred:

ImportError Traceback (most recent call last)
in ()
1 import numpy as np
----> 2 from keras.preprocessing.image import ImageDataGenerator
3 from keras.preprocessing import image
4 from keras.layers import Dropout, Flatten, Dense
5 from keras.applications import ResNet50

~\Anaconda3\lib\site-packages\keras_init_.py in ()
1 from future import absolute_import
2
----> 3 from . import utils
4 from . import activations
5 from . import applications

~\Anaconda3\lib\site-packages\keras\utils_init_.py in ()
4 from . import data_utils
5 from . import io_utils
----> 6 from . import conv_utils
7
8 # Globally-importable utils.

~\Anaconda3\lib\site-packages\keras\utils\conv_utils.py in ()
7 from six.moves import range
8 import numpy as np
----> 9 from … import backend as K
10
11

~\Anaconda3\lib\site-packages\keras\backend_init_.py in ()
85 elif _BACKEND == ‘tensorflow’:
86 sys.stderr.write(‘Using TensorFlow backend.\n’)
—> 87 from .tensorflow_backend import *
88 else:
89 # Try and load external backend.

~\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py in ()
3 from future import print_function
4
----> 5 import tensorflow as tf
6 from tensorflow.python.framework import ops as tf_ops
7 from tensorflow.python.training import moving_averages

~\Anaconda3\lib\site-packages\tensorflow_init_.py in ()
22
23 # pylint: disable=wildcard-import
—> 24 from tensorflow.python import *
25 # pylint: enable=wildcard-import
26

~\Anaconda3\lib\site-packages\tensorflow\python_init_.py in ()
47 import numpy as np
48
—> 49 from tensorflow.python import pywrap_tensorflow
50
51 # Protocol buffers

~\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in ()
50 for some common reasons and solutions. Include the entire stack trace
51 above this error message when asking for help.""" % traceback.format_exc()
—> 52 raise ImportError(msg)
53
54 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long

ImportError: Traceback (most recent call last):
File “C:\Users\kanaa\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”, line 18, in swig_import_helper
return importlib.import_module(mname)
File “C:\Users\kanaa\Anaconda3\lib\importlib_init_.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 994, in _gcd_import
File “”, line 971, in _find_and_load
File “”, line 955, in _find_and_load_unlocked
File “”, line 658, in _load_unlocked
File “”, line 571, in module_from_spec
File “”, line 922, in create_module
File “”, line 219, in _call_with_frames_removed
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\kanaa\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 41, in
from tensorflow.python.pywrap_tensorflow_internal import *
File “C:\Users\kanaa\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”, line 21, in
_pywrap_tensorflow_internal = swig_import_helper()
File “C:\Users\kanaa\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”, line 20, in swig_import_helper
return importlib.import_module('pywrap_tensorflow_internal’)
File "C:\Users\kanaa\Anaconda3\lib\importlib_init
.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named ‘_pywrap_tensorflow_internal’

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

‘’’

Is there some version that i’m missing to be able to run this?

NOTE: I’m running this on a windows PC, so please tell me what to do in windows.