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

itr is referenced before assignment in main.py, line 160 #85

Open
rahulbhadani opened this issue Jun 15, 2021 · 0 comments
Open

itr is referenced before assignment in main.py, line 160 #85

rahulbhadani opened this issue Jun 15, 2021 · 0 comments

Comments

@rahulbhadani
Copy link

rahulbhadani commented Jun 15, 2021

I am executing the omniglot test with the following command:

python main.py --datasource=omniglot --metatrain_iterations=60000 --meta_batch_size=32 --update_batch_size=1 --update_lr=0.4 --num_updates=1 --logdir=logs/omniglot5way/

However, I am getting the error:

Done initializing, starting training.
Traceback (most recent call last):
  File "main.py", line 348, in <module>
    main()
  File "main.py", line 343, in main
    train(model, saver, sess, exp_string, data_generator, resume_itr)
  File "main.py", line 160, in train
    saver.save(sess, FLAGS.logdir + '/' + exp_string +  '/model' + str(itr))
UnboundLocalError: local variable 'itr' referenced before assignment

I inspected the code of main.py and I find that in line 160, saver.save(sess, FLAGS.logdir + '/' + exp_string + '/model' + str(itr)) is being executed outside the for loop but itr variable is a loop iterator variable. Should the save function go inside the for loop?

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

1 participant