unity-ml-agents.net icon indicating copy to clipboard operation
unity-ml-agents.net copied to clipboard

I can't seem to get this working with the latest version of TF.Net

Open Phantomb opened this issue 5 years ago • 7 comments

Is it because of the move to TF 2.0? What should be changed to make it work with 2.0?

Phantomb avatar Oct 08 '20 14:10 Phantomb

Have you trid add tf.compat.v1.disable_eager_execution(); before you using tf.net?

Oceania2018 avatar Oct 08 '20 15:10 Oceania2018

I did add that, at the start of the LearningModel call:

public LearningModel(int? m_size = null,
            bool normalize = false,
            bool use_recurrent = false,
            BrainParameters brain = null,
            int seed = 0,
            List<string> stream_names = null)
        {
            tf.compat.v1.disable_eager_execution();

            tf.set_random_seed(seed);
            this.brain = brain;
            (global_step, increment_step, steps_to_increment) = create_global_steps();
            ...
         }

Would I need to add it anywhere else, or are there other changes I would need to make?

At first, there were also some errors thrown around the RefVariable type. In some places I changed it to ResourceVariable (since some of the methods now expect that type as input instead of RefVariable), in some places to Tensor.

Phantomb avatar Oct 08 '20 15:10 Phantomb

We have to refactor the model adapting tensorflow 2.x. Welcome if you can contribute to this project. I would glad to help if you need.

Oceania2018 avatar Oct 08 '20 16:10 Oceania2018

Would love to, but I'm kinda lost on where to get starten / what needs to be modified. Could you provide some pointers?

Phantomb avatar Oct 09 '20 12:10 Phantomb

We have to refactor the model adapting tensorflow 2.x. Welcome if you can contribute to this project. I would glad to help if you need.

any tips where to start?

samuelcaldas avatar Mar 19 '21 21:03 samuelcaldas

@Oceania2018 Is this project still active? If not, have you moved onto using ML.NET? A 2nd if not, how easy is it to use ML.NET to create game agents. I'd like to use ML.NET or ML Agents in an 3D game using MonoGame, but would like to use agents for the enemies, if possible.

CartBlanche avatar Dec 16 '23 16:12 CartBlanche

It's not active. I'll close this repo. I'll archive this project.

Oceania2018 avatar Dec 16 '23 18:12 Oceania2018