BVLC / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
34.06k stars 18.7k forks source link

[New Feature] Handle non-zero starting index label #6318

Open daizeng1984 opened 6 years ago

daizeng1984 commented 6 years ago

Issue summary

Sometimes when getting labels from other people generated by language like Matlab, the label index is starting from 1! Caffe seems not to handle this at all. Other framework work nicely with it. It's simple but useful and save people's time.

Steps to reproduce

Any lmdb with label index starting from non-zero.

Your system configuration

Operating system: Ubuntu 16.04.9 Compiler: 5.4.0 CUDA version (if applicable): 9.0.176 CUDNN version (if applicable): 7.1.1 BLAS: N/A Python or MATLAB version (for pycaffe and matcaffe respectively): 3.6.3

twmht commented 6 years ago

@daizeng1984

so you mean that caffe should provide a label offset indicating where the label index starting from?

daizeng1984 commented 6 years ago

@twmht Sorry for confusion. The key idea is to help diagnose if training has problems. I think the simplest one could be like: raising the exception when loss function finds problematic label. It's fine to save states and stop the training when this happens. Or stop the backprop and throw away the samples and prompt human readable warning.