getnamo / TensorFlow-Unreal

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

h5py produce crash of ue 4.20.2 #35

Open selimbek opened 6 years ago

selimbek commented 6 years ago

Hi,

I used this pluggin with Unreal Engine 4.18 where I was able to load keras models with the load_weights function. This one use h5py module so it was installed as well. And everything worked fine :)

Today i tryed to migrate my work to UE 4.20.2 and tensorflow-ue4 v0.9.0. Python modules seems to be correctly installed, and basic examples works fine. But when I install h5py module and run my project, the engine crash instantly (even if i dont import/use it in my python script) I tried to install manually keras and cython too... with no positive effects

This problem disapear when I uninstall h5py (but i can't load my weights anymore).

Have you an idea to solve this issue, or have you some suggestions to save/load keras models without using h5py dependencie ?

Thank you in advance, --Selim

getnamo commented 6 years ago

Strange, perhaps you used a different Tensorflow version for earlier models and this could have, for some reason, cause an incompatibility. The 4.18 build used either https://github.com/getnamo/tensorflow-ue4/releases/tag/0.5.0, https://github.com/getnamo/tensorflow-ue4/releases/tag/0.6.0, or https://github.com/getnamo/tensorflow-ue4/releases/tag/0.7.0 so the matching tensorflow version is between 1.4-1.6. Let's try to downgrade the 4.20 tensorflow version.

  1. For the updated project delete Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages
  2. Update https://github.com/getnamo/tensorflow-ue4/blob/master/Content/Scripts/upymodule.json to an older version (1.4, 1.5 or 1.6)
  3. launch the project and wait for all dependencies to install.

Let me know if that solves it, if not see what your logs say under Saved/Logs

vincentlorant commented 6 years ago

Hello,

I get a similar issue with UE 4.21.0. I successfully load my model using model_from_json() and the prediction works fine with default weights. However, when I install h5py to load my trained weights using load_weights(), UE crash.

@getnamo I tried to follow your method but UE crash with tensorflow 1.5 & 1.6. For "tensorflow": "1.4.0", I got the following error in the log: LogPython: Error: module 'enum' has no attribute 'IntFlag'

Any updates on how to solve this issue?

Thanks!

EDIT: I get the following errors in the crash reporter:

Access violation - code c0000005 (first/second chance not available)

_conv_cp36_win_amd64
_conv_cp36_win_amd64
python36
... //repeat many times python36
python36
UE4Editor_UnrealEnginePython
UE4Editor_Engine!AActor::InitializeComponents() [d:\build\++ue4\sync\engine\source\runtime\engine\private\actor.cpp:4315]
UE4Editor_Engine!ULevel::RouteActorInitialize() [d:\build\++ue4\sync\engine\source\runtime\engine\private\level.cpp:1822]
UE4Editor_Engine!UWorld::InitializeActorsForPlay() [d:\build\++ue4\sync\engine\source\runtime\engine\private\world.cpp:3642]
UE4Editor_Engine!UGameInstance::StartPlayInEditorGameInstance() [d:\build\++ue4\sync\engine\source\runtime\engine\private\gameinstance.cpp:376]
UE4Editor_UnrealEd!UEditorEngine::CreatePIEGameInstance() [d:\build\++ue4\sync\engine\source\editor\unrealed\private\playlevel.cpp:3332]
UE4Editor_UnrealEd!UEditorEngine::PlayInEditor() [d:\build\++ue4\sync\engine\source\editor\unrealed\private\playlevel.cpp:2459]
UE4Editor_UnrealEd!UEditorEngine::StartQueuedPlayMapRequest() [d:\build\++ue4\sync\engine\source\editor\unrealed\private\playlevel.cpp:1270]
UE4Editor_UnrealEd!UEditorEngine::Tick() [d:\build\++ue4\sync\engine\source\editor\unrealed\private\editorengine.cpp:1640]
UE4Editor_UnrealEd!UUnrealEdEngine::Tick() [d:\build\++ue4\sync\engine\source\editor\unrealed\private\unrealedengine.cpp:403]
UE4Editor!FEngineLoop::Tick() [d:\build\++ue4\sync\engine\source\runtime\launch\private\launchengineloop.cpp:3699]
UE4Editor!GuardedMain() [d:\build\++ue4\sync\engine\source\runtime\launch\private\launch.cpp:174]
UE4Editor!GuardedMainWrapper() [d:\build\++ue4\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:145]
UE4Editor!WinMain() [d:\build\++ue4\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:276]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:283]
kernel32
ntdll
codewing commented 5 years ago

I am facing the same error currently with UE4.21.0

getnamo commented 5 years ago

try downgrading h5py to e.g. 2.7 in https://github.com/getnamo/tensorflow-ue4/blob/master/Content/Scripts/upymodule.json