TensorFlow-Unreal
TensorFlow-Unreal copied to clipboard
Packaging Support
I did a quick build of the MNIST demo in the ue4-examples (win x64), but I get an error on launch:
AsyncLoading.cpp [Line: 3013] Missing Dependency, request for SockedIOClientComponent but it hasn't been created yet.
By building do you mean packaging? what version of plugin and ue4?
Yep I'm packaging. TensorFlowExamples-ue4.17-v0.2.1-noplugins.7z tensorflow-ue4.17-v0.4.1-cpu.7z UE 4.17.2
Steps: Extract TensorFlowExamples-ue4.17-v0.2.1 Extract the and move the plugins folder from TensorFlowExamples-ue4.17-v0.2.1 into the extracted project. Run the mnist map and wait a few minutes for dependencies to download. Relaunch project. Set mnist as the Game Default Map.
Package for win x64.
I get an error from UEPython LogPython: Error: No module named 'ue_site' So I create a empty python file ue_site.py in /Content/Scripts following the recommendation in the post bellow. https://github.com/20tab/UnrealEnginePython/issues/20
Package for win x64. Run the exe
Then I get the error
Fatal error: [File:D:\Build++UE4+Release-4.17+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\Serialization\AsyncLoading.cpp] [Line: 3013] Missing Dependency, request for SocketIOClientComponent but it hasn't been created yet.
I haven't tested packaging properly yet, it looks like the load order in a packaged game is different than in editor mode. Adding this bug to the list to look over for 4.18. You may be able to fix it by changing LoadingPhase
in https://github.com/getnamo/socketio-client-ue4/blob/282fe8d2dbbe37a2939e64d238aa278544641b58/SocketIOClient.uplugin
Thanks! I'll take a look!
Copied answer from #34
The most thorough coverage of packaging can be found at this issue: 20tab/UnrealEnginePython#163
If you can get the UnrealEnginePython plugin to package, the rest should package correctly. Consider first trying a smaller UnrealEnginePython project and getting it to package with it seeing your python dll correctly, then move on to including all the tensorflow things and see where it breaks.
Packaging is currently out of scope for my work atm so I'm depending on contributors to help fix the packaging situation. If you get something working, share here so we can get this working out of the box for future builds!
Ok got something to package after fixing minor compilation bugs for development mode. Currently requires to manually copy contents of {Project Root}/Plugins/UnrealEnginePython/Binaries/Win64
, {Project Root}/Plugins/UnrealEnginePython/Content/Scripts
, {Project Root}/Plugins/tensorflow-ue4/Content/Scripts
. and {Project Root}/Content/Scripts
to their respective folders in the packaged folder. Will look into automating this step and then write a guide.
Packaged build is still subject to 240 char limit, so project has to be placed somewhere with a short path (SN: another ping to getting https://github.com/getnamo/tensorflow-ue4/issues/36 implemented).
Support added in https://github.com/getnamo/tensorflow-ue4/releases/tag/0.9.3, see https://github.com/getnamo/tensorflow-ue4#packaging for instructions.
Let me know if any errors not mentioned crop up.
Updated release https://github.com/getnamo/tensorflow-ue4/releases/tag/0.10.0 it now won't generate the pathname too long error during build as it won't copy site-packages
during packaging. You'll need to run the packaged build once or copy them manually (see https://github.com/getnamo/tensorflow-ue4#packaging).
This is as clean as I could get the packaging setup to be due to staging paths being too long during the packing process.
Hey!
Thanks for this update, i really appreciate it 👍. Packaging now works out of the box for 4_20. Great job. It kinda bothers me, that there is black screen while py downloads requirements, but i can package required packages with game and that is fixed.
Awesome job
Thanks for the feedback! Agree on the black screen on startup problem, I opened a new issue https://github.com/getnamo/tensorflow-ue4/issues/38 for a suggested enhancement to fix this. May take some time before I can address it though.
Hey @getnamo!
I just tried to package the project with UE4.21 and needed to adjust some stuff in order to get it working.
First of all, the Python plugin wouldn't package properly due to an error in: "..\UnrealEnginePython\Source\UnrealEnginePython\Private\Wrappers\UEPyFFoliageInstance.cpp" The quick fix for this is to wrap all FFoliageMeshInfo appearances in it with the define "WITH_EDITORONLY_DATA" which can be found in "Runtime/Core/Public/Misc/CoreMiscDefines.h"
Secondly, I tried to package it with the source code of all plugins without embedded python - didn't worked. First problem was that it couldn't find and copy the "Tensorflow.dll" from the TF plugin thirdparty folder -> the quick fix was to copy it from your binary release -> worked out. However, the MNIST sample project still wasn't functional. Afterwards, I tried it with including/to copy the embedded Python and thirdparty folder/files of the Python plugin from your TF plugin binaries and it worked!
Update for UE4.22
In order to be able to at least package the game you need to wrap world->SetCurrentLevel(level)
in PyObject *py_ue_set_current_level(ue_PyUObject *self, PyObject * args)
in UEPyWorld.cpp like, e.g.:
#if WITH_EDITORONLY_DATA
if (world->SetCurrentLevel(level))
Py_RETURN_TRUE;
#endif
Great spot, care to make a pull request with that addition?