beyretb / AnimalAI-Olympics

Code repository for the Animal AI Olympics competition
Apache License 2.0
573 stars 84 forks source link

Error on environment reset with MetaCurriculum in TrainerController #68

Closed marlon360 closed 5 years ago

marlon360 commented 5 years ago

I created a MetaCurriculm and added it to the TrainerController. I got an error on the environment reset.

I modified the trainMLAgents.py:

# ...

maybe_meta_curriculum = MetaCurriculum('configs/curricula/')

# ...

tc = TrainerController(model_path, summaries_dir, run_id + '-' + str(sub_id),
                       save_freq, maybe_meta_curriculum,
                       load_model, train_model,
                       keep_checkpoints, lesson, external_brains, run_seed, arena_config_in)
tc.start_learning(env, trainer_config)

And this is the error:

Traceback (most recent call last):
  File "trainMLAgents.py", line 87, in <module>
    tc.start_learning(env, trainer_config)
  File "/Applications/anaconda3/envs/animalai/lib/python3.6/site-packages/animalai_train/trainers/trainer_controller.py", line 205, in start_learning
    curr_info = self._reset_env(env)
  File "/Applications/anaconda3/envs/animalai/lib/python3.6/site-packages/animalai_train/trainers/trainer_controller.py", line 183, in _reset_env
    return env.reset(config=self.meta_curriculum.get_config())
TypeError: reset() got an unexpected keyword argument 'config'
beyretb commented 5 years ago

I need to adapt the ML-Agents curriculum to work with yaml configuration files, this won't work at the moment. Let me have a look and get back to you with an ETA for this.

beyretb commented 5 years ago

Could you describe what you were trying to use as a curriculum? Did you want to be able to reset arenas with new configurations each time an agent reaches some threshold on a given metric?

marlon360 commented 5 years ago

Yes exactly. The documentation says that this is easy to implement, but I just know the ML-Agents way.

beyretb commented 5 years ago

Some update for you: I've adapted the MetaCurriculum and Curriculum to work with the yaml configuration files, I'm running some tests and writing documentation. I plan on releasing this in v1.1 on Monday.

beyretb commented 5 years ago

This is now live, you can find the documentation here

I'll leave this topic open for a bit in case there are any questions.