ValueError: Expected positive integer total_steps, but got -1 #11936
Answered
by
morestart
morestart
asked this question in
code help: CV
-
def configure_optimizers(self):
optimizer = torch.optim.SGD(self.parameters(), lr=self.lr)
print(self.trainer.max_steps)
lr_scheduler = {
'scheduler': torch.optim.lr_scheduler.OneCycleLR(optimizer,
max_lr=self.lr,
total_steps=self.trainer.max_steps,
anneal_strategy='linear',
cycle_momentum=False,
pct_start=0.1),
'interval': 'step',
'frequency': 1
}
return {'optimizer': optimizer, 'lr_scheduler': lr_scheduler, "monitor": 'val_acc'}
|
Beta Was this translation helpful? Give feedback.
Answered by
morestart
Feb 16, 2022
Replies: 1 comment 3 replies
-
ok i know the answer, |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
morestart
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ok i know the answer,