Hsankesara / Prototypical-Networks

A novel method for few shot learning
MIT License
50 stars 12 forks source link

'Optimizer' not initialized #1

Open TravisTianqing opened 5 years ago

TravisTianqing commented 5 years ago

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 commented 5 years ago

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

Hsankesara commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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