Skip to content
This repository has been archived by the owner on Jan 17, 2019. It is now read-only.

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

Open
AbuBakrCh opened this issue Aug 4, 2017 · 2 comments
Open

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

AbuBakrCh opened this issue Aug 4, 2017 · 2 comments

Comments

@AbuBakrCh
Copy link

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 ?

@AbuBakrCh AbuBakrCh changed the title DataSampler.lua:230: bad argument #3 to 'narrow' #190 DataSampler.lua:230: bad argument #3 to 'narrow' Aug 4, 2017
@kvananth
Copy link

Hey, were you able to solve this problem?

@AbuBakrCh
Copy link
Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants