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

ForcesTrainer error #582

Closed
kz29 opened this issue Sep 28, 2023 · 2 comments
Closed

ForcesTrainer error #582

kz29 opened this issue Sep 28, 2023 · 2 comments

Comments

@kz29
Copy link

kz29 commented Sep 28, 2023

I am getting the following error when I use ForcesTrainer on different models. I am trying to run train_s2ef_example from the tutorial folder. Any help will be appreciated.

427 if self.scheduler.scheduler_type == "ReduceLROnPlateau":
428 if self.step % eval_every == 0:
429 self.scheduler.step(
--> 430 metrics=val_metrics[primary_metric]["metric"],
431 )
432 else:
433 self.scheduler.step()

UnboundLocalError: local variable 'val_metrics' referenced before assignment
image

@abhshkdz
Copy link
Collaborator

Hey, have you specified a validation dataset? ReduceLROnPlateau uses val metrics to decide when to step the learning rate. Not specifying a validation set would raise the error you're seeing.

Alternatively, if you want to train without a validation set, try setting 'scheduler': "Null", in the optimizer dictionary. That'd use the same learning rate without any schedule on it.

@kz29
Copy link
Author

kz29 commented Oct 1, 2023

Thank you for the explanation. It is working now.

@kz29 kz29 closed this as completed Oct 1, 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

No branches or pull requests

2 participants