getnamo / TensorFlow-Unreal

TensorFlow plugin for the Unreal Engine.
Other
1.15k stars 211 forks source link

Import error after install (GPU version) #48

Open antonio1234567891011 opened 5 years ago

antonio1234567891011 commented 5 years ago

Hi guys Hope all is well the tensorflow plugin is installed and CUDA and CUDNN installed

LogPluginManager: Mounting plugin TensorFlow LogPython: Python Scripts search path: ../../../../../../Users/U1/Documents/Unreal Projects/MyProject/Plugins/tensorflow-ue4/Content/Scripts LogPython: Added TensorFlow Plugin Content/Scripts (C:/Users/U1/Documents/Unreal Projects/MyProject/Plugins/tensorflow-ue4/Content/Scripts) to sys.path LogPython: upymodule_importer::Resolving upymodule dependencies for tensorflow-ue4 LogPython: upymodule_importer::tensorflow-gpu 1.12.0 installed? True LogPython: upymodule_importer::2 tensorflow-ue4 upymodule dependencies resolved (if installation in progress, more async output will stream) LogPython: TensorFlow Plugin upymodule.json parsed

Then when i do : LogTemp: >>> import tensorflow as tf

This is the message: File "C:\Users\U1\Documents\Unreal Projects\MyProject\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import File "C:\Users\U1\Documents\Unreal Projects\MyProject\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\U1\Documents\Unreal Projects\MyProject\Plugins\UnrealEnginePython\Binaries\Win64\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) Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/errors LogPython: Error: File "C:\Users\U1\Documents\Unreal Projects\MyProject\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import LogPython: Error: File "C:\Users\U1\Documents\Unreal Projects\MyProject\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() LogPython: Error: File "C:\Users\U1\Documents\Unreal Projects\MyProject\Plugins\UnrealEnginePython\Binaries\Win64\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) LogPython: Error: File "C:\Users\U1\Documents\Unreal Projects\MyProject\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow__init__.py", line 24, in from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import LogPython: Error: File "C:\Users\U1\Documents\Unreal Projects\MyProject\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python__init__.py", line 49, in from tensorflow.python import pywrap_tensorflow LogPython: Error: File "C:\Users\U1\Documents\Unreal Projects\MyProject\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in File "C:\Users\U1\Documents\Unreal Projects\MyProject\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\U1\Documents\Unreal Projects\MyProject\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\U1\Documents\Unreal Projects\MyProject\Plugins\UnrealEnginePython\Binaries\Win64\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) Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/errors

sanford87 commented 5 years ago

I have the same problem. I've tried everything I can think of with no luck. I've got a M2200 GPU which is capable of running tensorflow. I only get this error using the plugin.

getnamo commented 5 years ago

Does the CPU version work?

sanford87 commented 5 years ago

Yes, The CPU version works. I can import numpy too without an issue but importing tensorflow throws the errors. I thought it might be a problem with using the python version that came with the plugins. BTW, amazing response time!!! It's pretty incredible what this plugin is capable of.

sanford87 commented 5 years ago

Would it help to post the initial logs from the first boot? It seems like everything installed correctly with 4 PATH warning similar to: WARNING: The script f2py.exe is installed in 'c:...\plugins\unrealenginepython\binaries\win64\Scripts' which is not on PATH.

I added that directory to PATH just to be safe but it didn't change anything.

sanford87 commented 5 years ago

Wow, Can't believe it took so long to figure this out... tensorflow isn't installed. I found it out after running pip.list() Solution: Create a new python script in the editor and run:

import upypip as pip pip.install('tensorflow')

getnamo commented 5 years ago

For both versions (CPU and GPU) it already does that, you just need to wait for the script to complete according to step 8 of https://github.com/getnamo/tensorflow-ue4#installation--setup. Versions installed are determined by https://github.com/getnamo/tensorflow-ue4/blob/master/Content/Scripts/upymodule.json where the gpu version will use tensorflow-gpu