Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(trainer): init self.generate_sweep_kwarg at self.__init__ #460

Merged
merged 4 commits into from
Apr 28, 2023

Conversation

mymusise
Copy link
Contributor

@mymusise mymusise commented Apr 28, 2023

If we do trainer.evaluate() before trainer.learn(), it will rasie AttributeError like:

│ ❱ 310 │   │   if self.generate_sweep_kwarg is not None:                                          │
│   311 │   │   │   gen_sweep_arg, gen_sweep_values = self.generate_sweep_kwarg                    │
│   312 │   │   else:                                                                              │
│   313 │   │   │   gen_sweep_values = [None]                                                      │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'AccelerateILQLTrainer' object has no attribute 'generate_sweep_kwarg'

so, I think it's better to initialize generate_sweep_kwarg with the initialization of the trainer

And the same with self.nth_evaluation

@maxreciprocate
Copy link
Collaborator

Makes sense! Maybe also let's move the block that initializes generate_sweep_kwarg along into trainer's initialization?

@mymusise
Copy link
Contributor Author

Makes sense! Maybe also let's move the block that initializes generate_sweep_kwarg along into trainer's initialization?

Makes sense! The initialization of generate_sweep_kwarg depends only on trainer.config.

Copy link
Collaborator

@maxreciprocate maxreciprocate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@maxreciprocate maxreciprocate merged commit d4b9217 into CarperAI:main Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants