CloserLookFewShot icon indicating copy to clipboard operation
CloserLookFewShot copied to clipboard

pytorch version

Open mileyan opened this issue 6 years ago • 4 comments

Hi, It is a nice work. Now I am facing some problems when running your code. So I want to make sure that I use the same pytorch as you. Which pytorch version did you use when you implement this project?

mileyan avatar Feb 16 '19 21:02 mileyan

Hello, My Pytorch version is 0.3.1, but I have also tested on 1.0 and it works. What does your error message say?

wyharveychen avatar Feb 20 '19 21:02 wyharveychen

It's a nice work+1 Just changed "loss.data[0]" to "loss.item()" in baselinetrain.py and it seems to work fine. I am using 1.0.1.post2 (pytorch version).

Wann-Jiun avatar Mar 01 '19 18:03 Wann-Jiun

I'm got the following error with 1.0.1.post2.

Traceback (most recent call last): File "./train.py", line 177, in model = train(base_loader, val_loader, model, optimization, start_epoch, stop_epoch, params) File "./train.py", line 32, in train model.train_loop(epoch, base_loader, optimizer ) #model are called by reference, no need to return File "/nfs/tynamo/home/data/vision7/stsutsui/public_repos/CloserLookFewShot/methods/baselinetrain.py", line 44, in train_loop avg_loss = avg_loss+loss.data[0] IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number

Well, I was so lazy to fix "loss.dada[0]" to "loss.item()" by myself, and didn't want to change the code without the author's confirmation so I installed 0.3.1 using the following command, then it worked.

conda install pytorch==0.3.1 torchvision -c pytorch

apple2373 avatar Mar 02 '19 23:03 apple2373

It's a nice work+1 Just changed "loss.dada[0]" to "loss.item()" in baselinetrain.py and it seems to work fine. I am using 1.0.1.post2 (pytorch version).

well... at least dada -> data.

russell0 avatar Jun 10 '19 20:06 russell0