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

step1_train_teacher.py", line 123 #17

Open
237014845 opened this issue May 15, 2021 · 1 comment
Open

step1_train_teacher.py", line 123 #17

237014845 opened this issue May 15, 2021 · 1 comment

Comments

@237014845
Copy link

Traceback (most recent call last):
File "step1_train_teacher.py", line 242, in
main()
File "step1_train_teacher.py", line 236, in main
run(config)
File "step1_train_teacher.py", line 204, in run
writer, visualizer, last_epoch+1)
File "step1_train_teacher.py", line 153, in train
eval_type='val')
File "step1_train_teacher.py", line 123, in evaluate_single_epoch
avg_loss = total_loss / (i+1)
UnboundLocalError: local variable 'i' referenced before assignment

@NeonLeexiang
Copy link

Traceback (most recent call last):
File "step1_train_teacher.py", line 242, in
main()
File "step1_train_teacher.py", line 236, in main
run(config)
File "step1_train_teacher.py", line 204, in run
writer, visualizer, last_epoch+1)
File "step1_train_teacher.py", line 153, in train
eval_type='val')
File "step1_train_teacher.py", line 123, in evaluate_single_epoch
avg_loss = total_loss / (i+1)
UnboundLocalError: local variable 'i' referenced before assignment

maybe you can define i and then use it in the training process, that's because it does not be defined outer the for circulation

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