Announcement

Collapse
No announcement yet.

TensorFlow

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    [PLUGIN] TensorFlow

    Hello devs!

    For the past couple of months I've been working on bringing TensorFlow to UE4, enabling the use of state of the art machine learning in our projects. The plugin has reached something I think is ready to try out, but it is very much a work in progress so please check it out and give some feedback if you can!

    Download
    Plugin


    Examples Project


    Limitations
    Windows platform only atm. Consider contributing to add support for your platform!

    Resources
    Latest documentation is always available at the github repositories.

    Plugin
    https://github.com/getnamo/tensorflow-ue4
    Examples Project
    https://github.com/getnamo/tensorflow-ue4-examples


    Examples - Mnist

    Made a simple mnist recognition example.


    Basic MNIST softmax classifier trained on begin play with sample training inputs streamed to the editor during training. When fully trained, UTexture2D (1-3) samples are tested for prediction.

    you can even use your browser on your phone or desktop to draw some shapes to try recognition



    Examples - Basic adding in TensorFlow
    Want just the basics? check out the basic.umap map which uses addExample.py to add float array together. This is a good entry point to see how to pass UE4 blueprint data into and out of python tensorflow.




    Examples - Upcoming Pong with QLearning AI

    Still training the pong AI with sped up time dilation, but you can track updates in the qlearn branch of the examples repository.




    Let me know what you think and what machine learning examples you'd like to see in the future!
    Plugins: TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo - RealSense - CIM

    #2
    getnamo - This is awesome!

    There are certain really cool projects that use TF that I'd love to be able to integrate into a game, e.g., Google's NLP parser SyntaxNet.

    Training a net to differentiate a person stepping vs just leaning in VR would also be really cool (though there's a nice asset for doing this already on the marketplace VR Footstep Plugin), and allow people to use full body avatars in VR without having to have extra trackers other than hands and head.
    Last edited by n00854180t; 09-21-2017, 06:35 PM.
    Storyteller - An immersive VR audiobook player

    Dungeon Survival - WIP First person dungeon crawler with a focus on survival and environmental gameplay ala roguelikes

    Comment


      #3
      Cool stuff
      Would be awesome if we could use this to Train enemy AI in a RPG game /or enemies in RTS game and then save the progress

      Comment


        #4
        This is awesome!

        Comment


          #5
          Originally posted by duyth View Post
          Cool stuff
          Would be awesome if we could use this to Train enemy AI in a RPG game /or enemies in RTS game and then save the progress
          You actually can

          Comment


            #6
            I am wondering if the new editor scripting capabilities can be used to directly integrate tensorflow into our projects?

            Comment


              #7
              It would be cool to see an LSTM for sequence learning in this! enemy predicting the players actions and acting on it.

              Comment


                #8
                Just curious: Can this plugin work after packaging?

                Comment


                  #9
                  Packaging support is a known missing feature. Progress is tracked here: https://github.com/getnamo/tensorflow-ue4/issues/16, contributions welcome
                  Plugins: TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo - RealSense - CIM

                  Comment


                    #10
                    First of all, thank you very much getnamo for your tremendous amount of work you're giving away basically for free (the couple of bucks on the marketplace are merely symbolic in this regard). I've started to play with Reinforcement Learning and tensorflow using Unity and the Learning Agents preview they provide, but now have switched to Unreal because of - well, many reasons.

                    So already working with tensorflow, I was and still am excited that the Unreal environment also has integration already. Big thanks again for making this possible!

                    I also was used to having tensorboard for better understanding what is going on with my learning agent. I've tried for a day now to get tensorboard running (writing out logs with the simple MNIST example from https://www.tensorflow.org/guide/sum...nd_tensorboard worked flawlessly), but I'm totally lost now, also because I'm just beginning writing python code, coming from a C++ and C# background. Have you tested running tensorboard already and could kindly give some guideline or tips how to make it work?

                    Comment


                      #11
                      Originally posted by HaBe2305 View Post
                      First of all, thank you very much getnamo for your tremendous amount of work you're giving away basically for free (the couple of bucks on the marketplace are merely symbolic in this regard). I've started to play with Reinforcement Learning and tensorflow using Unity and the Learning Agents preview they provide, but now have switched to Unreal because of - well, many reasons.

                      So already working with tensorflow, I was and still am excited that the Unreal environment also has integration already. Big thanks again for making this possible!

                      I also was used to having tensorboard for better understanding what is going on with my learning agent. I've tried for a day now to get tensorboard running (writing out logs with the simple MNIST example from https://www.tensorflow.org/guide/sum...nd_tensorboard worked flawlessly), but I'm totally lost now, also because I'm just beginning writing python code, coming from a C++ and C# background. Have you tested running tensorboard already and could kindly give some guideline or tips how to make it work?
                      https://github.com/getnamo/tensorflo...SimpleBoard.py is the only experiment I did with tensorboard. My understanding is that you have to run tensorboard separately to host the webpage and then using something like the above, you can feed in all the data it needs for visualization. There isn't anything in the plugin currently to bring that visualization into ue4, but you could use something like https://github.com/AaronShea/BLUI or the inbuilt chromium to display the webpage inside ue4. If you get something working consider contributing a simple example to https://github.com/getnamo/tensorflow-ue4-examples/
                      Last edited by getnamo; 09-22-2018, 04:08 PM.
                      Plugins: TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo - RealSense - CIM

                      Comment


                        #12
                        Originally posted by getnamo View Post

                        https://github.com/getnamo/tensorflo...SimpleBoard.py is the only experiment I did with tensorboard. My understanding is that you have to run tensorboard separately to host the webpage and then using something like the above, you can feed in all the data it needs for visualization. There isn't anything in the plugin currently to bring that visualization into ue4, but you could use something like https://github.com/AaronShea/BLUI or the inbuilt chromium to display the webpage inside ue4. If you get something working consider contributing a simple example to https://github.com/getnamo/tensorflow-ue4-examples/
                        Now that you say it, this absolutely makes sense. I tried to run tensorboard from inside UE, the idea that I easily could run it from a standalone python console as well on the logs didn't come to my mind at that time. Thanks for the enlightenment.

                        I'll experiment with the inbuilt chromium browser first. I wanted to adopt the workflow and setup Unity uses (external python distro via Anaconda) anyways since they have some nice goodies in their SDK like curiosity reinforced learning, circulum learning, imitation learning etc, and I'll certainly contribute it to your repo as soon as it's stable.
                        Do you prefer pull requests from a branch, a fork or another way?
                        Last edited by HaBe2305; 09-22-2018, 05:23 PM.

                        Comment


                          #13
                          Originally posted by HaBe2305 View Post

                          Now that you say it, this absolutely makes sense. I tried to run tensorboard from inside UE, the idea that I easily could run it from a standalone python console as well on the logs didn't come to my mind at that time. Thanks for the enlightenment.

                          I'll experiment with the inbuilt chromium browser first. I wanted to adopt the workflow and setup Unity uses (external python distro via Anaconda) anyways since they have some nice goodies in their SDK like curiosity reinforced learning, circulum learning, imitation learning etc, and I'll certainly contribute it to your repo as soon as it's stable.
                          Do you prefer pull requests from a branch, a fork or another way?
                          Sounds good . A pull request on master is fine, I can always retarget it to a working branch if it breaks too much
                          Plugins: TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo - RealSense - CIM

                          Comment


                            #14
                            Recent update:
                            With the v0.10.1 (https://github.com/getnamo/tensorflo...ses/tag/0.10.1) release the plugin now supports packaging. Let me know if there are any issues with this.
                            Plugins: TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo - RealSense - CIM

                            Comment


                              #15
                              Originally posted by getnamo View Post
                              Recent update:
                              With the v0.10.1 (https://github.com/getnamo/tensorflo...ses/tag/0.10.1) release the plugin now supports packaging. Let me know if there are any issues with this.
                              Have you released the pong game yet? I'm currently developing a simple 2d game with a stick that tries to avoid enemies that are moving in the environment by pulling up/down the stick.

                              Comment

                              Working...
                              X