Seite 1 von 1

Tensorflow Installation - "Failed to load runtime."

Verfasst: Samstag 30. November 2019, 20:18
von xXSkyWalkerXx1
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

Re: Tensorflow Installation - "Failed to load runtime."

Verfasst: Sonntag 1. Dezember 2019, 16:17
von ThomasL
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?

Re: Tensorflow Installation - "Failed to load runtime."

Verfasst: Sonntag 1. Dezember 2019, 18:28
von xXSkyWalkerXx1
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?

Re: Tensorflow Installation - "Failed to load runtime."

Verfasst: Sonntag 1. Dezember 2019, 18:44
von __deets__
Die ist nicht zu alt. Die ist nicht geeignet. CUDA ist NVIDIA.

Re: Tensorflow Installation - "Failed to load runtime."

Verfasst: Sonntag 1. Dezember 2019, 18:58
von sparrow
Ein A6 ist vor allem eine CPU und keine GPU.

Re: Tensorflow Installation - "Failed to load runtime."

Verfasst: Sonntag 1. Dezember 2019, 19:29
von xXSkyWalkerXx1
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?

Re: Tensorflow Installation - "Failed to load runtime."

Verfasst: Sonntag 1. Dezember 2019, 19:39
von kbr
Kurzes googeln zeigt, dass Deine CPU noch kein AVX unterstützt:
http://www.cpu-world.com/Compare/568/AM ... -6410.html

Re: Tensorflow Installation - "Failed to load runtime."

Verfasst: Sonntag 1. Dezember 2019, 19:40
von ThomasL
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

Re: Tensorflow Installation - "Failed to load runtime."

Verfasst: Sonntag 1. Dezember 2019, 19:42
von xXSkyWalkerXx1
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.