-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to communicate real time? #25
Comments
You can check out the old qlearning branch examples for in the loop communication: https://github.com/getnamo/tensorflow-ue4-examples/blob/qlearn/Content/Scripts/PongAI.py The basics of it is call a json input with your ai input e.g. wheel location, images as float arrays, etc, then run your python code inside the function https://github.com/getnamo/tensorflow-ue4-examples/blob/qlearn/Content/Scripts/PongAI.py#L63 and return a result. On unreal side use the updated outputs to update your simulation (e.g. steering). |
thanks for sharing, but you know, using the pip command in the same directory I could update the TensorFlow, ((pip install TensorFlow == 2.6.1)) and now the python editor in the Unreal Engine 4.18.3 recognize (Tensorflow. Keras) but another question has arisen is, how can I use the Unreal output as an Input for python script? for example, I want a way of communication between python and the Unreal engine. |
Convert your input to json and reshape the inputs into the size/dimensions your network expects. There's a handy struct to json string converter which can be used to feed the input, see this section of the documentation https://github.com/getnamo/tensorflow-ue4#basic-json-string and https://github.com/getnamo/tensorflow-ue4#basic-json-string Keep in mind typically NNs expect float array inputs. |
I have a question, I've trained a model in TensorFlow.Keras and now my python editor in the Unreal Engined 4.18.3, have all modules I need (i.e TensorFlow and Keras) but in the case of the driving simulator I need communication between python scripts and the Unreal Environment, how can I do that?
The text was updated successfully, but these errors were encountered: