facebookresearch / deepmask

Torch implementation of DeepMask and SharpMask
Other
3.11k stars 507 forks source link

DataSampler.lua:230: bad argument #3 to 'narrow' #111

Open AbuBakrCh opened 7 years ago

AbuBakrCh commented 7 years ago

While training my own dataset, after one epoch I am getting this error:

/data/mabubakr/torch/install/bin/lua: ...mabubakr/torch/install/share/lua/5.2/threads/threads.lua:183: [thread 2 callback] /data/mabubakr/code/deepmask/DataSampler.lua:230: bad argument #3 to 'narrow' (out of range at /data/mabubakr/torch/pkg/torch/lib/TH/generic/THTensor.c:435) stack traceback: [C]: in function 'narrow' /data/mabubakr/code/deepmask/DataSampler.lua:230: in function 'cropTensor' /data/mabubakr/code/deepmask/DataSampler.lua:254: in function 'cropMask' /data/mabubakr/code/deepmask/DataSampler.lua:154: in function 'maskSampling' /data/mabubakr/code/deepmask/DataSampler.lua:111: in function 'get' /data/mabubakr/code/deepmask/DataLoader.lua:70: in function </data/mabubakr/code/deepmask/DataLoader.lua:64> (...tail calls...) [C]: in function 'xpcall' ...mabubakr/torch/install/share/lua/5.2/threads/threads.lua:234: in function 'callback' ...a/mabubakr/torch/install/share/lua/5.2/threads/queue.lua:65: in function <...a/mabubakr/torch/install/share/lua/5.2/threads/queue.lua:41> [C]: in function 'pcall' ...a/mabubakr/torch/install/share/lua/5.2/threads/queue.lua:40: in function 'dojob' [string " local Queue = require 'threads.queue'..."]:15: in main chunk stack traceback: [C]: in function 'error' ...mabubakr/torch/install/share/lua/5.2/threads/threads.lua:183: in function 'dojob' /data/mabubakr/code/deepmask/DataLoader.lua:95: in function 'for iterator' /data/mabubakr/code/deepmask/TrainerDeepMask.lua:68: in function 'train' train.lua:117: in main chunk [C]: in function 'dofile' ...bakr/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk [C]: in ?

kvananth commented 6 years ago

Hey, were you able to solve this problem?

AbuBakrCh commented 6 years ago

My dataset had wrong segmentation values.

Try to round numbers to maximum two decimal places. Remove negative values. Check for other issues in your annotation file.