Prototypical-Networks icon indicating copy to clipboard operation
Prototypical-Networks copied to clipboard

'Optimizer' not initialized

Open TravisTianqing opened this issue 6 years ago • 4 comments
trafficstars

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 avatar Oct 31 '19 10:10 TravisTianqing

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

TravisTianqing avatar Nov 01 '19 02:11 TravisTianqing

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 avatar Nov 02 '19 10:11 Hsankesara

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 avatar Nov 02 '19 10:11 Hsankesara

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

Hsankesara avatar Nov 02 '19 10:11 Hsankesara