chsasank / plantvillage-challenge

Code in Torch for PlantVillage challenge: https://www.crowdai.org/challenges/1
17 stars 11 forks source link

bad argument #1 to '?' (must be strictly positive at /tmp/luarocks_torch-scm-1-2561/torch7/lib/TH/generic/THTensorMath.c:1467) #2

Open SeekPoint opened 7 years ago

SeekPoint commented 7 years ago

rzai@rzai00:~/prj/plantvillage-challenge/crowdai_train_tar$ ll total 20 drwxrwxr-x 4 rzai rzai 4096 12月 23 11:38 ./ drwxrwxr-x 4 rzai rzai 4096 12月 23 11:35 ../ -rw-rw-r-- 1 rzai rzai 74 12月 23 11:38 divide_dat.sh drwxrwxr-x 40 rzai rzai 4096 12月 23 11:38 train/ drwxrwxr-x 40 rzai rzai 4096 12月 23 11:38 val/ rzai@rzai00:~/prj/plantvillage-challenge/crowdai_train_tar$ rzai@rzai00:~/prj/plantvillage-challenge/crowdai_train_tar$ cd .. rzai@rzai00:~/prj/plantvillage-challenge$ th main.lua -model alexnet -data crowdai_train_tar Creating new alexnet model
=> Training epoch # 1
[======================================== 21917/21917 ================================>] Tot: 4m18s | Step: 9ms
train Loss: 2.3574 Accuracy: 35.75 time: 259.87 s ==> Validating
/home/rzai/torch/install/bin/luajit: bad argument #1 to '?' (must be strictly positive at /tmp/luarocks_torch-scm-1-2561/torch7/lib/TH/generic/THTensorMath.c:1467) stack traceback: [C]: at 0x7f405a1308b0 [C]: in function 'randperm' ...zai/prj/plantvillage-challenge/datasets/plantvillage.lua:36: in function 'valGenerator' /home/rzai/prj/plantvillage-challenge/train.lua:87: in function 'validate' main.lua:72: in main chunk [C]: in function 'dofile' ...rzai/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk [C]: at 0x00406670 rzai@rzai00:~/prj/plantvillage-challenge$

pankajkumar commented 7 years ago

Hello @loveJasmine ,

I am also getting the same error while trying to train my model on torch and openNMT, Can you please share how did your fixed it?

SeekPoint commented 7 years ago

@pankajkumar I just want have a quick eval on this project, not fix it

pankajkumar commented 7 years ago

No issues, I am trying out different things. Will share here if I am able to fix it. Any helpful eval are welcome too.

pankajkumar commented 7 years ago

Update: It has been fixed by specifying correct src_seq_length and tgt_seq_length in my case