getnamo / TensorFlow-Unreal-Examples

Drag and drop Unreal Engine TensorFlow examples repository.
MIT License
219 stars 45 forks source link

Example Project + Latest Binary Release Not Training #12

Closed nonlin closed 5 years ago

nonlin commented 6 years ago

I've downloaded the example project and copied into it the latest release of tensflow for UE4. I've made sure to enable all three plugins and I have no errors at all.

However no training is being done. None of the example projects work.

getnamo commented 6 years ago

Just tested a download of https://github.com/getnamo/tensorflow-ue4-examples/releases/tag/0.2.3 and https://github.com/getnamo/tensorflow-ue4/releases/tag/0.6.0 (nb: you need the files inside the .7z file not source).

I extracted the 0.2.3 project, dragged in plugins folder from the 0.6.0 archive and then opened the project and waited ~ 4min until the output log showed:

Collecting tensorflow==1.5.0
  Using cached tensorflow-1.5.0-cp36-cp36m-win_amd64.whl
Collecting tensorflow-tensorboard<1.6.0,>=1.5.0 (from tensorflow==1.5.0)
  Downloading tensorflow_tensorboard-1.5.1-py3-none-any.whl (3.0MB)
Collecting absl-py>=0.1.6 (from tensorflow==1.5.0)
  Downloading absl-py-0.1.10.tar.gz (79kB)
Collecting numpy>=1.12.1 (from tensorflow==1.5.0)
  Downloading numpy-1.14.1-cp36-none-win_amd64.whl (13.4MB)
Collecting six>=1.10.0 (from tensorflow==1.5.0)
  Using cached six-1.11.0-py2.py3-none-any.whl
Requirement already satisfied: wheel>=0.26 in c:\users\admin\desktop\tensorflow-ue4-examples\plugins\unrealenginepython\binaries\win64\lib\site-packages (from tensorflow==1.5.0)
Collecting protobuf>=3.4.0 (from tensorflow==1.5.0)
  Using cached protobuf-3.5.1-py2.py3-none-any.whl
Collecting bleach==1.5.0 (from tensorflow-tensorboard<1.6.0,>=1.5.0->tensorflow==1.5.0)
  Using cached bleach-1.5.0-py2.py3-none-any.whl
Collecting html5lib==0.9999999 (from tensorflow-tensorboard<1.6.0,>=1.5.0->tensorflow==1.5.0)
Collecting markdown>=2.6.8 (from tensorflow-tensorboard<1.6.0,>=1.5.0->tensorflow==1.5.0)
  Using cached Markdown-2.6.11-py2.py3-none-any.whl
Collecting werkzeug>=0.11.10 (from tensorflow-tensorboard<1.6.0,>=1.5.0->tensorflow==1.5.0)
  Using cached Werkzeug-0.14.1-py2.py3-none-any.whl
Requirement already satisfied: setuptools in c:\users\admin\desktop\tensorflow-ue4-examples\plugins\unrealenginepython\binaries\win64\lib\site-packages (from protobuf>=3.4.0->tensorflow==1.5.0)
Building wheels for collected packages: absl-py
  Running setup.py bdist_wheel for absl-py: started
  Running setup.py bdist_wheel for absl-py: finished with status 'done'
  Stored in directory: C:\Users\Admin\AppData\Local\pip\Cache\wheels\45\07\0e\6880381ca521796cf6cc18ba4ab502c2232e5777099b4df4ae
Successfully built absl-py
Installing collected packages: six, html5lib, bleach, numpy, markdown, werkzeug, protobuf, tensorflow-tensorboard, absl-py, tensorflow
Successfully installed absl-py-0.1.10 bleach-1.5.0 html5lib-0.9999999 markdown-2.6.11 numpy-1.14.1 protobuf-3.5.1 six-1.11.0 tensorflow-1.5.0 tensorflow-tensorboard-1.5.1 werkzeug-0.14.1

then closed the project and re-opened it as per https://github.com/getnamo/tensorflow-ue4#no-module-named-tensorflow problem.

After the project loaded the second time, hitting play started training kerasCNN. Having used the cpu version of tensorflow it started training right away, albeit slowly. Stopped play and changed the Python TFModule to mnistSpawnSamples on the ConnectedTFMnistActor and hit play again, this time the much simpler regression model was trained in <3 seconds while streaming images. Classification tests also worked as expected.

From a basic test, it appears to be working. Where in this process are you hitting a snag? Kindly provide more information/step by step instructions so the issue can be reproduced as you experience it.

getnamo commented 6 years ago

Realized the readme installation and setup didn't clarify the waiting step, I've now added a bit more in those sections for both the plugin and the examples repository.

nonlin commented 6 years ago

After following your direction I'm seeing the following output log for both CPU and GPU versions of the plugin.

LogWorld: Bringing World /Game/ExampleAssets/Maps/UEDPIE_0_Mnist.Mnist up for play (max tick rate 0) at 2018.03.04-09.29.09
LogPython: Error: No module named 'tensorflow'
LogPython: Error: Traceback (most recent call last):
LogPython: Error:   File "G:/Chrome Downloads/TensorFlowExamples-ue4.18-v0.2.3-noplugins/tensorflow-ue4-examples/Plugins/tensorflow-ue4/Content/Scripts\TensorFlowComponent.py", line 2, in <module>
    import tensorflow as tf
LogPython: Error: ModuleNotFoundError: No module named 'tensorflow'
LogWorld: Bringing up level for play took: 0.112011
LogContentBrowser: Native class hierarchy updated for 'MovieSceneCapture' in 0.0003 seconds. Added 11 classes and 0 folders.
PIE: Play in editor start time for /Game/ExampleAssets/Maps/UEDPIE_0_Mnist 0.17
SocketIOLog: SocketIO Connected with session: PQFSPD_IF7pVpCeUAAyb
SocketIOLog: SocketIO PQFSPD_IF7pVpCeUAAyb connected to namespace: /
SocketIOLog: SocketIO Disconnected PQFSPD_IF7pVpCeUAAyb reason: CLOSE_REASON_NORMAL
SocketIOLog: SocketIO PQFSPD_IF7pVpCeUAAyb disconnected from namespace: /
getnamo commented 6 years ago

Did you restart the project one more time after seeing the dependencies installed in your log? seems to hint strongly at: https://github.com/getnamo/tensorflow-ue4#no-module-named-tensorflow issue

nonlin commented 6 years ago

So literally just wait with it running and no indication of it doing anything?

getnamo commented 6 years ago

Yes, unfortunately I didn't figure out how to do immediate piping through commandline so it will pipe everything only once it's done. Definitely a place that could use some eyes/contributions so that the first setup experience is as smooth as possible. Ideally we should get the pip output and estimate some progress bar in a umg gui as it works.

nonlin commented 6 years ago

I've had it run for 15 + min and nothing has changed.

EDIT: Ran for 30+ Minutes and restarted project to see if it did anything. Still nothing.

getnamo commented 6 years ago

Try hitting play after project loads up and then stop. Then wait no more than 10min. It shouldn't take that long for sure. I think it needs a world play to start but I'm not sure what else could be different.

If that doesn't work, try following alternative instructions by another user's video here https://www.youtube.com/watch?v=ZciLnYV4jIo

getnamo commented 6 years ago

You can also manually install the dependencies by going to the python plugin binaries folder and using pip.exe manually. Or also optionally change the path to another python install location on your computer by modifying the python plugin build.cs

getnamo commented 6 years ago

Made a new release which fixes the restart issue: https://github.com/getnamo/tensorflow-ue4/releases/tag/0.7.0. You should be able to just delete the plugins folder and redrag the new 0.7 release into your project.

Let me know if that one works for you. If it still doesn't install properly for you check your log and maybe use the python console to see what's going on with your dependencies. Instructions for using the inbuilt pip can be found here: https://github.com/getnamo/tensorflow-ue4#use-pip-to-manage-your-dependencies-in-the-python-console.

nonlin commented 6 years ago

This is what I see now.

cmd Result: 
Collecting tensorflow==1.6.0
  Using cached tensorflow-1.6.0-cp36-cp36m-win_amd64.whl
Collecting numpy>=1.13.3 (from tensorflow==1.6.0)
  Using cached numpy-1.14.1-cp36-none-win_amd64.whl
Collecting absl-py>=0.1.6 (from tensorflow==1.6.0)
Collecting grpcio>=1.8.6 (from tensorflow==1.6.0)
  Using cached grpcio-1.10.0-cp36-cp36m-win_amd64.whl
Collecting astor>=0.6.0 (from tensorflow==1.6.0)
  Using cached astor-0.6.2-py2.py3-none-any.whl
Collecting six>=1.10.0 (from tensorflow==1.6.0)
  Using cached six-1.11.0-py2.py3-none-any.whl
Requirement already satisfied: wheel>=0.26 in g:\chrome downloads\tensorflowexamples-ue4.18-v0.2.3-noplugins\tensorflow-ue4-examples\plugins\unrealenginepython\binaries\win64\lib\site-packages (from tensorflow==1.6.0)
Collecting protobuf>=3.4.0 (from tensorflow==1.6.0)
  Using cached protobuf-3.5.1-py2.py3-none-any.whl
Collecting termcolor>=1.1.0 (from tensorflow==1.6.0)
Collecting tensorboard<1.7.0,>=1.6.0 (from tensorflow==1.6.0)
  Using cached tensorboard-1.6.0-py3-none-any.whl
Collecting gast>=0.2.0 (from tensorflow==1.6.0)
Requirement already satisfied: setuptools in g:\chrome downloads\tensorflowexamples-ue4.18-v0.2.3-noplugins\tensorflow-ue4-examples\plugins\unrealenginepython\binaries\win64\lib\site-packages (from protobuf>=3.4.0->tensorflow==1.6.0)
Collecting markdown>=2.6.8 (from tensorboard<1.7.0,>=1.6.0->tensorflow==1.6.0)
  Using cached Markdown-2.6.11-py2.py3-none-any.whl
Collecting bleach==1.5.0 (from tensorboard<1.7.0,>=1.6.0->tensorflow==1.6.0)
  Using cached bleach-1.5.0-py2.py3-none-any.whl
Collecting werkzeug>=0.11.10 (from tensorboard<1.7.0,>=1.6.0->tensorflow==1.6.0)
  Using cached Werkzeug-0.14.1-py2.py3-none-any.whl
Collecting html5lib==0.9999999 (from tensorboard<1.7.0,>=1.6.0->tensorflow==1.6.0)
Installing collected packages: numpy, six, absl-py, protobuf, grpcio, astor, termcolor, markdown, html5lib, bleach, werkzeug, tensorboard, gast, tensorflow
Exception:
Traceback (most recent call last):
  File "g:\chrome downloads\tensorflowexamples-ue4.18-v0.2.3-noplugins\tensorflow-ue4-examples\plugins\unrealenginepython\binaries\win64\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "g:\chrome downloads\tensorflowexamples-ue4.18-v0.2.3-noplugins\tensorflow-ue4-examples\plugins\unrealenginepython\binaries\win64\lib\site-packages\pip\commands\install.py", line 342, in run
    prefix=options.prefix_path,
  File "g:\chrome downloads\tensorflowexamples-ue4.18-v0.2.3-noplugins\tensorflow-ue4-examples\plugins\unrealenginepython\binaries\win64\lib\site-packages\pip\req\req_set.py", line 784, in install
    **kwargs
  File "g:\chrome downloads\tensorflowexamples-ue4.18-v0.2.3-noplugins\tensorflow-ue4-examples\plugins\unrealenginepython\binaries\win64\lib\site-packages\pip\req\req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "g:\chrome downloads\tensorflowexamples-ue4.18-v0.2.3-noplugins\tensorflow-ue4-examples\plugins\unrealenginepython\binaries\win64\lib\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "g:\chrome downloads\tensorflowexamples-ue4.18-v0.2.3-noplugins\tensorflow-ue4-examples\plugins\unrealenginepython\binaries\win64\lib\site-packages\pip\wheel.py", line 377, in move_wheel_files
    clobber(source, dest, False, fixer=fixer, filter=filter)
  File "g:\chrome downloads\tensorflowexamples-ue4.18-v0.2.3-noplugins\tensorflow-ue4-examples\plugins\unrealenginepython\binaries\win64\lib\site-packages\pip\wheel.py", line 323, in clobber
    shutil.copyfile(srcfile, destfile)
  File "shutil.py", line 121, in copyfile
FileNotFoundError: [Errno 2] No such file or directory: 'g:\\chrome downloads\\tensorflowexamples-ue4.18-v0.2.3-noplugins\\tensorflow-ue4-examples\\plugins\\unrealenginepython\\binaries\\win64\\Lib\\site-packages\\tensorflow\\contrib\\receptive_field\\python\\util\\examples\\__pycache__\\write_inception_resnet_v2_graph.cpython-36.pyc'
getnamo commented 6 years ago

I suspect you're having an issue with the location you're using. Have you tried somewhere where you don't need admin privileges e.g. the desktop? optionally, do you have long path names enabled? (https://superuser.com/questions/1119883/windows-10-enable-ntfs-long-paths-policy-option-missing)

getnamo commented 5 years ago

Try latest project with matching plugin: https://github.com/getnamo/tensorflow-ue4-examples/releases/tag/0.4.1

and make sure you place your project somewhere with a short enough path (e.g. desktop should be sufficient).

Re-open issue if it persists in new releases.