Tensorflow Installation - "Failed to load runtime."

Wenn du dir nicht sicher bist, in welchem der anderen Foren du die Frage stellen sollst, dann bist du hier im Forum für allgemeine Fragen sicher richtig.
Antworten
xXSkyWalkerXx1
User
Beiträge: 379
Registriert: Mittwoch 27. Juni 2018, 17:39

Guten Abend,

Nachdem ich nun mein Bitcoin-Bot fertig habe, wollte ich mich nun mit Deep-Learning befassen.
Ich hatte es bereits vor ein paar Monaten versucht gehabt, bekam da allerdings auch schon den gleichen Fehlercode.

Wenn ich ein Python-Code mit Tensorflow und Keras starten möchte, erhalte ich immer folgenden Fehlercode:

Code: Alles auswählen

Traceback (most recent call last):
  File "C:\Users\Philipp\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\Philipp\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\Philipp\AppData\Local\Programs\Python\Python35\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:\Users\Philipp\AppData\Local\Programs\Python\Python35\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\Philipp\AppData\Local\Programs\Python\Python35\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed with error code -1073741795

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Philipp\Desktop\Python\AI\keras_CNN.py", line 1, in <module>
    import tensorflow as tf
  File "C:\Users\Philipp\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\__init__.py", line 98, in <module>
    from tensorflow_core import *
  File "C:\Users\Philipp\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow_core\__init__.py", line 40, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "C:\Users\Philipp\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
    module = self._load()
  File "C:\Users\Philipp\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\__init__.py", line 44, in _load
    module = _importlib.import_module(self.__name__)
  File "C:\Users\Philipp\AppData\Local\Programs\Python\Python35\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\Users\Philipp\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow_core\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\Philipp\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:\Users\Philipp\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\Philipp\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\Philipp\AppData\Local\Programs\Python\Python35\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:\Users\Philipp\AppData\Local\Programs\Python\Python35\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\Philipp\AppData\Local\Programs\Python\Python35\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed with error code -1073741795

Failed to load the native TensorFlow runtime.
Ich habe Tensorflow2.0 mittels "python -m pip install tensorflow" (also auf Windows) installiert. Ich hatte auch gelesen, dass man CUDA und cuDNN braucht, hab ich alles installiert. Auch in %PATH% steckt CUDA nun drin. Wobei ich allerdings bei vielen Tutorials gelesen habe, dass man es nur mit pip installieren brauch & fertig ist man.

Ich bräuchte nun also Mal Hilfe, denn ich habe schon bereits den 1/4 Tag damit verbracht nach einer Lösung zu suchen, aber nichts hat geholfen.

Grüße,
xXSkyWalkerXx1
Benutzeravatar
ThomasL
User
Beiträge: 1379
Registriert: Montag 14. Mai 2018, 14:44
Wohnort: Kreis Unna NRW

Da in den Pfaden überall \Python35\ steht, vermute ich mal, dass Tensorflow 2 ein aktuelleres Python benötigt.

Edit: Habe gerade hier https://www.tensorflow.org/install/pip gesehen, das Python > 3.4 ok ist.
Bist du denn gemäß der dortigen Beschreibungen vorgegangen?
Ich bin Pazifist und greife niemanden an, auch nicht mit Worten.
Für alle meine Code Beispiele gilt: "There is always a better way."
https://projecteuler.net/profile/Brotherluii.png
xXSkyWalkerXx1
User
Beiträge: 379
Registriert: Mittwoch 27. Juni 2018, 17:39

Ja, habe ich, außer Visual-Studios zu installieren, das wird doch nicht unbedingt benötigt.

Allerdings habe ich das gelesen:
Hardware requirements
Starting with TensorFlow 1.6, binaries use AVX instructions which may not run on older CPUs.
Read the GPU support guide to set up a CUDA®-enabled GPU card on Ubuntu or Windows.
Meine CPU ist die "AMD A6-3670", ist die vllt zu alt?
__deets__
User
Beiträge: 14545
Registriert: Mittwoch 14. Oktober 2015, 14:29

Die ist nicht zu alt. Die ist nicht geeignet. CUDA ist NVIDIA.
Benutzeravatar
sparrow
User
Beiträge: 4538
Registriert: Freitag 17. April 2009, 10:28

Ein A6 ist vor allem eine CPU und keine GPU.
xXSkyWalkerXx1
User
Beiträge: 379
Registriert: Mittwoch 27. Juni 2018, 17:39

Bezüglich meiner CPU ging es mir um diesen Satz.
Hardware requirements
Starting with TensorFlow 1.6, binaries use AVX instructions which may not run on older CPUs.
Heißt das, dass ich eine GraKa (*edit: CPU) brauch, um Tensorflow nutzen zu können oder wie?
Zuletzt geändert von xXSkyWalkerXx1 am Sonntag 1. Dezember 2019, 19:43, insgesamt 1-mal geändert.
Benutzeravatar
kbr
User
Beiträge: 1508
Registriert: Mittwoch 15. Oktober 2008, 09:27

Kurzes googeln zeigt, dass Deine CPU noch kein AVX unterstützt:
http://www.cpu-world.com/Compare/568/AM ... -6410.html
Benutzeravatar
ThomasL
User
Beiträge: 1379
Registriert: Montag 14. Mai 2018, 14:44
Wohnort: Kreis Unna NRW

Nein, das heißt, dass du eine neue CPU benötigst oder einen neueren PC oder Laptop.
AVX gibt es erst ab AMD FX Processoren, siehe hier: https://de.wikipedia.org/wiki/Advanced_ ... Extensions
Ich bin Pazifist und greife niemanden an, auch nicht mit Worten.
Für alle meine Code Beispiele gilt: "There is always a better way."
https://projecteuler.net/profile/Brotherluii.png
xXSkyWalkerXx1
User
Beiträge: 379
Registriert: Mittwoch 27. Juni 2018, 17:39

kbr hat geschrieben: Sonntag 1. Dezember 2019, 19:39 Kurzes googeln zeigt, dass Deine CPU noch kein AVX unterstützt:
http://www.cpu-world.com/Compare/568/AM ... -6410.html
Uff, so ein Dreck! Also eine neue CPU kaufen.
Hat jede neue CPU AVX?

Kennt jemand ein guten Laptop für max. ~400€ zum Programmieren & Zocken? :D
Möchte mir nächstes Jahr eh ein Laptop kaufen, da ich dann mit meiner Freundin zusammenziehe, somit kauf ich mir keine CPU für 80€ oder so.

Oder hole mir den Jetson-Nano. Der ist ja für Deep-Learning.
Antworten