xbpeng / DeepMimic

Motion imitation with deep reinforcement learning.
https://xbpeng.github.io/projects/DeepMimic/index.html
MIT License
2.27k stars 485 forks source link

requirements.txt installing too recent tensorflow #170

Closed alan-man closed 2 years ago

alan-man commented 2 years ago

Hi, As today, requirements.txt installs tensorflow>=1.3.0 With today's python3, this installs TF2. DeepMimic does not seem to be compatible with TF2 :

alant@Nitro:~/repos/DeepMimic$ python3 DeepMimic.py --arg_file args/run_humanoid3d_spinkick_args.txt
Invalid MIT-MAGIC-COOKIE-1 keyTraceback (most recent call last):
  File "DeepMimic.py", line 10, in <module>
    from learning.rl_world import RLWorld
  File "/home/alant/repos/DeepMimic/learning/rl_world.py", line 2, in <module>
    import learning.agent_builder as AgentBuilder
  File "/home/alant/repos/DeepMimic/learning/agent_builder.py", line 3, in <module>
    from learning.ppo_agent import PPOAgent
  File "/home/alant/repos/DeepMimic/learning/ppo_agent.py", line 5, in <module>
    from learning.pg_agent import PGAgent
  File "/home/alant/repos/DeepMimic/learning/pg_agent.py", line 6, in <module>
    from learning.solvers.mpi_solver import MPISolver
  File "/home/alant/repos/DeepMimic/learning/solvers/mpi_solver.py", line 4, in <module>
    import learning.tf_util as TFUtil
  File "/home/alant/repos/DeepMimic/learning/tf_util.py", line 5, in <module>
    xavier_initializer = tf.contrib.layers.xavier_initializer()
AttributeError: module 'tensorflow' has no attribute 'contrib'

In TF2, contrib has moved to some external projects... Long term solution would be to upgrade DeepMimic to TF2 @xbpeng Would you accept a PR if I retouch the requirements.txt with: tensorflow==1.13.1 as advised in the main readme ? Thanks

xbpeng commented 2 years ago

You're right, the code is likely not compatible with TF2. Feel free to submit a PR for correcting requirements.txt and I'll get that merged.

WilliamTambellini commented 2 years ago

@xbpeng have you thought (would you accept a PR) to upgrade to TF2?

xbpeng commented 2 years ago

Sure, if you have a PR for that, I can take a look. I am a bit worried about how much needs to be changed to get things upgraded.

alan-man commented 2 years ago

A new issue could be open to update to TF2.