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

Code Error - Cannot Run Successfully #5

Closed
lihaoliu-cambridge opened this issue Jul 16, 2022 · 1 comment
Closed

Code Error - Cannot Run Successfully #5

lihaoliu-cambridge opened this issue Jul 16, 2022 · 1 comment

Comments

@lihaoliu-cambridge
Copy link

Thanks for sharing your code.

However, this repo is problematic. I follow your instruction to run it. The code cannot be run directly, with the following error.

Traceback (most recent call last):
File "run.py", line 417, in
header3 = "** LR Config: Init: {} | Peak: {} | Warmup Epoch: {} | Rise: {} | Decay {} | train params {} | all params {} ".format([float(f'{sch.get_last_lr()[0]:.6f}') for sch in lr_schedulers], [float(f'{v:.6f}') for v in wp_lr], warmups, power, decay_rate, pytorch_train_params, pytorch_total_params)
File "run.py", line 417, in
header3 = "
LR Config: Init: {} | Peak: {} | Warmup Epoch: {} | Rise: {} | Decay {} | train params {} | all params {} **".format([float(f'{sch.get_last_lr()[0]:.6f}') for sch in lr_schedulers], [float(f'{v:.6f}') for v in wp_lr], warmups, power, decay_rate, pytorch_train_params, pytorch_total_params)
File "/XXX/python3.7/site-packages/torch/optim/lr_scheduler.py", line 99, in get_last_lr
return self._last_lr
AttributeError: 'SequentialLR' object has no attribute '_last_lr'

When I solve it follow the instruction in #2 (comment), another print error appears.

Traceback (most recent call last):
File "run.py", line 434, in
print("Traning | lr: {} | epoch {}".format([lr.get_last_lr() for lr in lr_schedulers], epoch), end=" | ", file=open(logfile, 'a+'))
File "run.py", line 434, in
print("Traning | lr: {} | epoch {}".format([lr.get_last_lr() for lr in lr_schedulers], epoch), end=" | ", file=open(logfile, 'a+'))
File "XXX/python3.7/site-packages/torch/optim/lr_scheduler.py", line 99, in get_last_lr
return self._last_lr
AttributeError: 'SequentialLR' object has no attribute '_last_lr'

@nwoyecid
Copy link
Member

nwoyecid commented Jul 17, 2022 via email

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