Unity-Technologies / ml-agents

The Unity Machine Learning Agents Toolkit (ML-Agents) is an open-source project that enables games and simulations to serve as environments for training intelligent agents using deep reinforcement learning and imitation learning.
https://unity.com/products/machine-learning-agents
Other
17.19k stars 4.16k forks source link

Gym examples don't work with TF2.0 #4229

Closed DVonk closed 4 years ago

DVonk commented 4 years ago

I may have overlooked something, but when installing ml-agents with pip, it automatically installs TF2.0. But the examples on this page don't work with that version: https://github.com/Unity-Technologies/ml-agents/blob/master/gym-unity/README.md

OpenAI baselines doesn't seem to be updated to 2.0 - same with Dopamine. So the examples just don't work if you install ml-agents normally.

1) What is the suggested course of action? Should I downgrade to 1.15? Seems a bit counterproductive. 2) Are you planning on updating this? Right now there's no gym example in your doc that actually works with the default installation.

vincentpierre commented 4 years ago

Hi, gym_unity and mlagents_envs do not have dependencies on TensorFlow. Only mlagents (the trainers) have a dependency on TensorFlow. If you want to run Baselines or Dopamine, you do not need to mlagents package and I recommend making a new virtual environment without mlagents (and only gym_unity) to help you manage the dependencies. I think if you want to use Baselines or Dopamine, you should use the versions of TensorFlow these frameworks need (meaning downgrading).

DVonk commented 4 years ago

Okay, thank you. You might want to add an annotation to your documentation though. Since those examples just don't work if you install ml-agents in the recommended way.

So do you have any suggestions on a library that does work with TF2.0? I don't intend to downgrade, as I think this newer version is leagues above the one we had before. I was thinking about trying TF-Agents, but maybe you have some other suggestion.

abhilash1910 commented 4 years ago

Hi @DVonk @vincentpierre , I think the Experimental Stable Baselines (https://github.com/Stable-Baselines-Team/stable-baselines-tf2) is consistent for Tf 2 version. The Baselines are not yet migrated to Tf 2 version and I use the experimental version to run the baseline algorithms. There is an alternate repository by Tan Zhenyu (https://github.com/tanzhenyu) for baselines on Tf 2 , on mostly A2c and its improvisations (https://github.com/tanzhenyu/baselines-tf2). Hope this helps Thanks

github-actions[bot] commented 3 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.