huggingface / deep-rl-class

This repo contains the syllabus of the Hugging Face Deep Reinforcement Learning Course.
Apache License 2.0
3.87k stars 594 forks source link

Unit 7 Hands-on SoccerTwos.app appears damaged on Apple Silicon #215

Closed sgoodfriend closed 1 year ago

sgoodfriend commented 1 year ago
Screenshot 2023-02-02 at 11 56 59 AM

This is after running the mlagents-learn command:

❯ mlagents-learn ./config/poca/SoccerTwos.yaml --env=./training-envs-executables/SoccerTwos/SoccerTwos.app --run-id="SoccerTwos" --no-graphics

            ┐  ╖
        ╓╖╬│╡  ││╬╖╖
    ╓╖╬│││││┘  ╬│││││╬╖
 ╖╬│││││╬╜        ╙╬│││││╖╖                               ╗╗╗
 ╬╬╬╬╖││╦╖        ╖╬││╗╣╣╣╬      ╟╣╣╬    ╟╣╣╣             ╜╜╜  ╟╣╣
 ╬╬╬╬╬╬╬╬╖│╬╖╖╓╬╪│╓╣╣╣╣╣╣╣╬      ╟╣╣╬    ╟╣╣╣ ╒╣╣╖╗╣╣╣╗   ╣╣╣ ╣╣╣╣╣╣ ╟╣╣╖   ╣╣╣
 ╬╬╬╬┐  ╙╬╬╬╬│╓╣╣╣╝╜  ╫╣╣╣╬      ╟╣╣╬    ╟╣╣╣ ╟╣╣╣╙ ╙╣╣╣  ╣╣╣ ╙╟╣╣╜╙  ╫╣╣  ╟╣╣
 ╬╬╬╬┐     ╙╬╬╣╣      ╫╣╣╣╬      ╟╣╣╬    ╟╣╣╣ ╟╣╣╬   ╣╣╣  ╣╣╣  ╟╣╣     ╣╣╣┌╣╣╜
 ╬╬╬╜       ╬╬╣╣      ╙╝╣╣╬      ╙╣╣╣╗╖╓╗╣╣╣╜ ╟╣╣╬   ╣╣╣  ╣╣╣  ╟╣╣╦╓    ╣╣╣╣╣
 ╙   ╓╦╖    ╬╬╣╣   ╓╗╗╖            ╙╝╣╣╣╣╝╜   ╘╝╝╜   ╝╝╝  ╝╝╝   ╙╣╣╣    ╟╣╣╣
   ╩╬╬╬╬╬╬╦╦╬╬╣╣╗╣╣╣╣╣╣╣╝                                             ╫╣╣╣╣
      ╙╬╬╬╬╬╬╬╣╣╣╣╣╣╝╜
          ╙╬╬╬╣╣╣╜
             ╙

 Version information:
  ml-agents: 0.31.0.dev0,
  ml-agents-envs: 0.31.0.dev0,
  Communicator API: 1.5.0,
  PyTorch: 1.11.0
[WARNING] Environment timed out shutting down. Killing...
Traceback (most recent call last):
  File "/Users/sgoodfriend/miniconda3/envs/hf-marl-py39/bin/mlagents-learn", line 33, in <module>
    sys.exit(load_entry_point('mlagents', 'console_scripts', 'mlagents-learn')())
  File "/Users/sgoodfriend/ml/ml-agents/ml-agents/mlagents/trainers/learn.py", line 264, in main
    run_cli(parse_command_line())
  File "/Users/sgoodfriend/ml/ml-agents/ml-agents/mlagents/trainers/learn.py", line 260, in run_cli
    run_training(run_seed, options, num_areas)
  File "/Users/sgoodfriend/ml/ml-agents/ml-agents/mlagents/trainers/learn.py", line 136, in run_training
    tc.start_learning(env_manager)
  File "/Users/sgoodfriend/ml/ml-agents/ml-agents-envs/mlagents_envs/timers.py", line 305, in wrapped
    return func(*args, **kwargs)
  File "/Users/sgoodfriend/ml/ml-agents/ml-agents/mlagents/trainers/trainer_controller.py", line 172, in start_learning
    self._reset_env(env_manager)
  File "/Users/sgoodfriend/ml/ml-agents/ml-agents-envs/mlagents_envs/timers.py", line 305, in wrapped
    return func(*args, **kwargs)
  File "/Users/sgoodfriend/ml/ml-agents/ml-agents/mlagents/trainers/trainer_controller.py", line 105, in _reset_env
    env_manager.reset(config=new_config)
  File "/Users/sgoodfriend/ml/ml-agents/ml-agents/mlagents/trainers/env_manager.py", line 68, in reset
    self.first_step_infos = self._reset_env(config)
  File "/Users/sgoodfriend/ml/ml-agents/ml-agents/mlagents/trainers/subprocess_env_manager.py", line 446, in _reset_env
    ew.previous_step = EnvironmentStep(ew.recv().payload, ew.worker_id, {}, {})
  File "/Users/sgoodfriend/ml/ml-agents/ml-agents/mlagents/trainers/subprocess_env_manager.py", line 101, in recv
    raise env_exception
mlagents_envs.exception.UnityTimeOutException: The Unity environment took too long to respond. Make sure that :
     The environment does not need user interaction to launch
     The Agents' Behavior Parameters > Behavior Type is set to "Default"
     The environment and the Python interface have compatible versions.
     If you're running on a headless server without graphics support, turn off display by either passing --no-graphics option or build your Unity executable as server build.
simoninithomas commented 1 year ago

Hey there :wave: , did you run this: or Mac you need also to call this xattr -cr training-envs-executables/SoccerTwos/SoccerTwos.app to be able to run SoccerTwos

sgoodfriend commented 1 year ago

I had not. After running xattr it worked!

lsdxp commented 1 year ago

what should happen after running xattr? I tried that also but it seems i am still getting the above error.

lsdxp commented 1 year ago

what should happen after running xattr? I tried that also but it seems i am still getting the above error.

ok, after running xattr to clear, then you need to start the application in the folder, then you shall see the unity environment window, but when i tried to start train, it prompts to start another SoccersTwo and failed

sgoodfriend commented 1 year ago

This is possibly irrelevant, but this is my directory structure when I got it to work:

Screenshot 2023-02-07 at 11 49 51 AM
lsdxp commented 1 year ago

This is possibly irrelevant, but this is my directory structure when I got it to work:

Screenshot 2023-02-07 at 11 49 51 AM

I have the same folder structure. I find my issue is because my macbook is an old one.

refer solution: #220