Я продолжаю получать сообщение об ошибке при попытке использовать keras в python - PullRequest
0 голосов
/ 28 марта 2020

Я пытаюсь go через глубокое обучение с Python от Chollet, но я не могу заставить Кераса работать. Я попытался переустановить Keras и Tensorflow, но это не помогает. Я использую Keras 2.3.1 и Tensorflow 2.1.0. Я пытался установить Tensorflow 2.0.0, но у него тоже были свои проблемы. Я использую ноутбук Jupyter.

Я пытаюсь запустить первую строку кода в книге:

from keras.datasets import mnist
(train_images, train_labels), (test_images, test_labels) = mnist.load_data()

И я продолжаю получать эту ошибку:

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

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

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

... LOTS MORE ERRORS I LEFT OUT ...


Failed to load the native TensorFlow runtime.

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
c:\programming\python\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py in <module>
     57 
---> 58   from tensorflow.python.pywrap_tensorflow_internal import *
     59   from tensorflow.python.pywrap_tensorflow_internal import __version__

c:\programming\python\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py in <module>
     27             return _mod
---> 28     _pywrap_tensorflow_internal = swig_import_helper()
     29     del swig_import_helper

c:\programming\python\lib\site-packages\tensorflow_core\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:\programming\python\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:\programming\python\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: The specified module could not be found.

During handling of the above exception, another exception occurred:


During handling of the above exception, another exception occurred:

AttributeError                            Traceback (most recent call last)
c:\programming\python\lib\site-packages\IPython\core\interactiveshell.py in showtraceback(self, exc_tuple, filename, tb_offset, exception_only, running_compiled_code)
   2033                         # in the engines. This should return a list of strings.
-> 2034                         stb = value._render_traceback_()
   2035                     except Exception:

AttributeError: 'ImportError' object has no attribute '_render_traceback_'

During handling of the above exception, another exception occurred:

TypeError                                 Traceback (most recent call last)
c:\programming\python\lib\site-packages\IPython\core\interactiveshell.py in run_code(self, code_obj, result, async_)
   3334             if result is not None:
   3335                 result.error_in_exec = sys.exc_info()[1]
-> 3336             self.showtraceback(running_compiled_code=True)
   3337         else:
   3338             outflag = False

c:\programming\python\lib\site-packages\IPython\core\interactiveshell.py in showtraceback(self, exc_tuple, filename, tb_offset, exception_only, running_compiled_code)
   2035                     except Exception:
   2036                         stb = self.InteractiveTB.structured_traceback(etype,
-> 2037                                             value, tb, tb_offset=tb_offset)
   2038 
   2039                     self._showtraceback(etype, value, stb)

c:\programming\python\lib\site-packages\IPython\core\ultratb.py in structured_traceback(self, etype, value, tb, tb_offset, number_of_lines_of_context)
   1416             self.tb = tb
   1417         return FormattedTB.structured_traceback(
-> 1418             self, etype, value, tb, tb_offset, number_of_lines_of_context)
   1419 
   1420 

c:\programming\python\lib\site-packages\IPython\core\ultratb.py in structured_traceback(self, etype, value, tb, tb_offset, number_of_lines_of_context)
   1316             # Verbose modes need a full traceback
   1317             return VerboseTB.structured_traceback(
-> 1318                 self, etype, value, tb, tb_offset, number_of_lines_of_context
   1319             )
   1320         elif mode == 'Minimal':

c:\programming\python\lib\site-packages\IPython\core\ultratb.py in structured_traceback(self, etype, evalue, etb, tb_offset, number_of_lines_of_context)
   1184         exception = self.get_parts_of_chained_exception(evalue)
   1185         if exception:
-> 1186             formatted_exceptions += self.prepare_chained_exception_message(evalue.__cause__)
   1187             etype, evalue, etb = exception
   1188         else:

TypeError: can only concatenate str (not "list") to str
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...