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

'Optimizer' not initialized #1

Open
TravisTianqing opened this issue Oct 31, 2019 · 4 comments
Open

'Optimizer' not initialized #1

TravisTianqing opened this issue Oct 31, 2019 · 4 comments

Comments

@TravisTianqing
Copy link

Traceback (most recent call last):
File "main.py", line 67, in
main()
File "main.py", line 42, in main
loss, acc = train_step(protonet, trainx, trainy, 5, 60, 5)
File "/home/serversys005/wangtianqing/mnt/prototypical/prototypicalNet.py", line 158, in train_step
optimizer.zero_grad()
NameError: name 'optimizer' is not defined

@TravisTianqing
Copy link
Author

It could be run when we use 'Adam' to initialize the optimizer, is this ok ?

@Hsankesara
Copy link
Owner

Hey Travis, I'm sorry I couldn't respond earlier. I was outstation for a few days.

That is bad from my side. I'll update the patch as soon as possible.

@Hsankesara
Copy link
Owner

It could be run when we use 'Adam' to initialize the optimizer, is this ok?

I believe Adam optimizer would work without any issues.

@Hsankesara
Copy link
Owner

Hey @TravisTianqing, I updated the code. If you again face an issue please let me know. You can also check out the kaggle notebook

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