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

unable to import from keras.preprocessing potential problem with tensorflow #360

Open
mgc1909 opened this issue Apr 16, 2020 · 1 comment

Comments

@mgc1909
Copy link

mgc1909 commented Apr 16, 2020

I have installed keras and tensorflow in pip but when I try to run this line on Jupyter notebook:

from keras.preprocessing.text import Tokenizer

It shows this error, hope you can help me:


ImportError Traceback (most recent call last)
c:\users\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in
57
---> 58 from tensorflow.python.pywrap_tensorflow_internal import *
59

c:\users\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in
27 return _mod
---> 28 _pywrap_tensorflow_internal = swig_import_helper()
29 del swig_import_helper

c:\users\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in swig_import_helper()
23 try:
---> 24 _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
25 finally:

c:\users\appdata\local\programs\python\python38\lib\imp.py in load_module(name, file, filename, details)
241 else:
--> 242 return load_dynamic(name, filename, file)
243 elif type_ == PKG_DIRECTORY:

c:\users\appdata\local\programs\python\python38\lib\imp.py in load_dynamic(name, path, file)
341 name=name, loader=loader, origin=path)
--> 342 return _load(spec)
343

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

During handling of the above exception, another exception occurred:

ImportError Traceback (most recent call last)
in
----> 1 from keras.preprocessing.text import Tokenizer

c:\users\appdata\local\programs\python\python38\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

c:\users\appdata\local\programs\python\python38\lib\site-packages\keras\utils_init_.py in
4 from . import data_utils
5 from . import io_utils
----> 6 from . import conv_utils
7 from . import losses_utils
8 from . import metrics_utils

c:\users\appdata\local\programs\python\python38\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

c:\users\appdata\local\programs\python\python38\lib\site-packages\keras\backend_init_.py in
----> 1 from .load_backend import epsilon
2 from .load_backend import set_epsilon
3 from .load_backend import floatx
4 from .load_backend import set_floatx
5 from .load_backend import cast_to_floatx

c:\users\appdata\local\programs\python\python38\lib\site-packages\keras\backend\load_backend.py in
88 elif _BACKEND == 'tensorflow':
89 sys.stderr.write('Using TensorFlow backend.\n')
---> 90 from .tensorflow_backend import *
91 else:
92 # Try and load external backend.

c:\users\appdata\local\programs\python\python38\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.eager import context
7 from tensorflow.python.framework import device as tfdev

c:\users\appdata\local\programs\python\python38\lib\site-packages\tensorflow_init_.py in
39 import sys as _sys
40
---> 41 from tensorflow.python.tools import module_util as _module_util
42 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader
43

c:\users\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python_init_.py in
48 import numpy as np
49
---> 50 from tensorflow.python import pywrap_tensorflow
51
52 # Protocol buffers

c:\users\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in
67 for some common reasons and solutions. Include the entire stack trace
68 above this error message when asking for help.""" % traceback.format_exc()
---> 69 raise ImportError(msg)
70
71 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long

ImportError: Traceback (most recent call last):
File "c:\users\marin\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "c:\users\marin\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "c:\users\marin\appdata\local\programs\python\python38\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\marin\appdata\local\programs\python\python38\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "c:\users\marin\appdata\local\programs\python\python38\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: The specified module could not be found.

@Frankie-Machine
Copy link

Can i be assigned this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants