Geen module met de naam ‘_pywrap_tensorflow_internal’

Terwijl ik probeer de installatie van tensorflow-gpu te valideren, krijg ik een ImportError wanneer ik “import tensorflow as tf” probeer uit te voeren. Ik gebruik een Quadro K620 op Windows 7. Tensorflow is geïnstalleerd met pip.

Het volgende is de stacktracering:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
C:\Users\aagarwal>python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AM
D64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
Traceback (most recent call last):
  File "C:\Users\aagarwal\AppData\Local\Programs\Python\Python35\lib\site-packag
es\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_hel
per
    return importlib.import_module(mname)
  File "C:\Users\aagarwal\AppData\Local\Programs\Python\Python35\lib\importlib\_
_init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 577, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 906, in create_module
  File "<frozen importlib._bootstrap>", line 222, 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\aagarwal\AppData\Local\Programs\Python\Python35\lib\site-packag
es\tensorflow\python\pywrap_tensorflow.py", line 41, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\aagarwal\AppData\Local\Programs\Python\Python35\lib\site-packag
es\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\aagarwal\AppData\Local\Programs\Python\Python35\lib\site-packag
es\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_hel
per
    return importlib.import_module('_pywrap_tensorflow_internal')
  File "C:\Users\aagarwal\AppData\Local\Programs\Python\Python35\lib\importlib\_
_init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\aagarwal\AppData\Local\Programs\Python\Python35\lib\site-packag
es\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "C:\Users\aagarwal\AppData\Local\Programs\Python\Python35\lib\site-packag
es\tensorflow\python\__init__.py", line 51, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\aagarwal\AppData\Local\Programs\Python\Python35\lib\site-packag
es\tensorflow\python\pywrap_tensorflow.py", line 52, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:\Users\aagarwal\AppData\Local\Programs\Python\Python35\lib\site-packag
es\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_hel
per
    return importlib.import_module(mname)
  File "C:\Users\aagarwal\AppData\Local\Programs\Python\Python35\lib\importlib\_
_init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 577, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 906, in create_module
  File "<frozen importlib._bootstrap>", line 222, 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\aagarwal\AppData\Local\Programs\Python\Python35\lib\site-packag
es\tensorflow\python\pywrap_tensorflow.py", line 41, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\aagarwal\AppData\Local\Programs\Python\Python35\lib\site-packag
es\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\aagarwal\AppData\Local\Programs\Python\Python35\lib\site-packag
es\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_hel
per
    return importlib.import_module('_pywrap_tensorflow_internal')
  File "C:\Users\aagarwal\AppData\Local\Programs\Python\Python35\lib\importlib\_
_init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_pywrap_tensorflow_internal'
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/install_sources#common_installation_probl
ems
for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.
>>>

Ik heb naar meerdere andere stapeloverloopposten gekeken, zoals het corrigeren van het pad, maar ik heb dit probleem niet kunnen oplossen.


Antwoord 1, autoriteit 100%

Ik kwam vandaag hetzelfde probleem tegen. Schakel in plaats daarvan over naar cuDNN v5.1 Library voor Windows zoals @mickdelaney suggereerde en probeer vervolgens

  1. Controleer de omgevingsinstellingen van CUDA, normaal gesproken waren alle instellingen van CUDA toegevoegd aan de Windows-omgeving

  2. Kopieer bestanden in bin, liben includevan cuDNN naar bin, liben includevan respectievelijk CUDA. Normaal gesproken is de map C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA

En dan kun je tensorflow importeren en je code uitvoeren. Veel succes!


Antwoord 2, autoriteit 96%

Ik heb de oplossing voor de CPU gevonden: het werkte voor mij

Voer indien nodig het onderstaande commando uit en werk het vervolgens bij

pip install tensorflow==1.5


Antwoord 3, autoriteit 50%

je zou de huidige versie van tensorflow kunnen verwijderen en een lage versie zoals TensorFlow 0.12 kunnen proberen met behulp van de code

pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl

https://blog.csdn.net/baidu_36669549/article/details/79734590


Antwoord 4, autoriteit 33%

Nadat u de CUDA-stuurprogramma’s hebt geïnstalleerd, moet u cuDNN downloaden en vrijgeven. Daarna mag je de cudnn64_5.dllnaar PATH kopiëren.
Als dat niet werkt, verplaats dan de cudnn64_5.dllnaar
NVIDIA GPU Computing Toolkit\CUDA\v8.0\binen probeer het opnieuw. Anders zou je een fout tegenkomen die je ziet.


Antwoord 5, autoriteit 33%

https://github.com/tensorflow/tensorflow/issues/7705

overschakelen naar cuDNN 5.1 in plaats van 6.0


Antwoord 6, autoriteit 33%

Ik had dezelfde fout met anaconda, het was eerder geïnstalleerd met een ander programma via anaconda. Opnieuw installeren via conda-forgewerkte: conda install -c conda-forge tensorflow


Antwoord 7

Ik kreeg nog steeds deze fout na het installeren van cuDNN 5.1 (ja, ik had PATH correct ingesteld). Ik had meer geluk met het installeren van tensorflow_gpu van deze site. Dit vereist cuDNN 6.0, niet 5.1. Helaas hebben ze momenteel alleen Tensorflow 1.1 voor GPU-systemen.


Antwoord 8

dit draait allemaal om uw videochip/kaart en CPU-compatibiliteit met TF VERSION! De huidige versie van Tensor Flow is 1.8 en het crasht op mijn beide machines.

Ik heb een win7 Gateway-notebook met een I5-CPU en Intel-videochip. Ik heb een desktop win7-eenheid met AMD Phenom II en AMD Radeon HD5450 videokaart. De I5-notebook vereist V1.6 van TensorFlow en de desktop AMD-eenheid heeft V1.5. Ik heb geen GPU beschikbaar voor het uitvoeren van ANN’s, dus ik weet niet hoe dat van invloed is.

Hier is de opdrachtregel voor PIP-installatie: pip install –upgrade tensorflow==1.5.0 (of welke andere versie je ook nodig hebt). Hiermee wordt uw huidige versie verwijderd en vervolgens de aangegeven versie geïnstalleerd.

Bouw of kopieer een klein TensorFlow-script en voer het uit in een opdrachtvenster. Open een tweede opdrachtvenster en installeer een andere versie. Ik raad aan om bij 1,5 te beginnen en naar boven te werken.


Antwoord 9

Het enige dat voor mij werkte (Windows 10) is:
Installeer Microsoft Visual C++ 2015 Redistributable Update 3
Als je een nieuwe, frisse computerconfiguratie hebt, kan deze ontbreken.


Antwoord 10

Ik ben een Chinees, dus mijn Engels is slecht, en mijn antwoord is dat hoe je cudnn 7 of 6 of 5 ook gebruikt, je de dll moet hernoemen van cudnn64_x.dll naar cudnn64_6.dll nadat je bestanden hebt gekopieerd.
misschien moet je binnenkort de dll hernoemen naar 7 of 8 of 9.

Other episodes