Saya mencoba mengikuti tutorial AI di sini: https://www.youtube.com/ tonton?v=WFr2WgN9_xE

Tetapi pada 11:56 ketika dia menjalankan program, saya mendapatkan kesalahan ini:

Traceback (most recent call last):
  File "C:\Users\Joshua\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\Joshua\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\Joshua\anaconda3\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\Joshua\anaconda3\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\Joshua\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/Joshua/PycharmProjects/ tensorEnv/test.py", line 1, in <module>
    import tensorflow
  File "C:\Users\Joshua\anaconda3\lib\site-packages\tensorflow\__init__.py", line 41, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "C:\Users\Joshua\anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 50, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\Joshua\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 69, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:\Users\Joshua\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\Joshua\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\Joshua\anaconda3\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\Joshua\anaconda3\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\Joshua\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.

Saya mencoba menginstal ulang tensorflow dengan pip install tensorflow, tetapi saya mendapatkan kesalahan ini:

ERROR: Could not install packages due to an EnvironmentError: 
[Errno 2] No such file or directory: 'C:\\Users\\Joshu
a\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python37
\\site-packages\\tensorboard_plugin_wit\\_vendor\\tensorflow_serving\\sources\\storage_path\\__pycache__\\file_syste
m_storage_path_source_pb2.cpython-37.pyc'

Apakah ada yang tahu cara memperbaiki ini?

0
WinstonMan 2 Juli 2020, 04:35

1 menjawab

Jawaban Terbaik

Aku telah memperbaikinya! Saya menginstal versi lama tensorflow dengan pip install tensorflow==1.15.2. Penghargaan untuk @Micheal Chen karena menunjukkan kepada saya tautan ke masalah serupa

0
WinstonMan 2 Juli 2020, 15:28