Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataLayer with float labels (ex: for regression) #2851

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

axel-angel
Copy link

There are multiple requests for allowing floating point in the label of Data Layer. I just hacked a bit and that's what I got so far. It seems to work with EuclideanLoss but crash with SoftmaxWithLoss.

Anyway, my questions are: if this is not a good idea, why? Is there an alternative as simple as writing a text file with image and label? I don't think so, so why not extend it for floating point? The next step is to allow multiple labels of course, which seem to be addressed in other PR.

If this feature is approved then I would gladly take a hint considering the problem with softmax (valgrind says):

==2931== Thread 4:
==2931== Invalid read of size 16
==2931==    at 0x9360CF3: sgemm_kernel_SANDYBRIDGE (in /usr/lib/libopenblasp-r0.2.14.so)
==2931==  Address 0x2e488d1c is 6,859,996 bytes inside a block of size 6,860,000 alloc'd
==2931==    at 0x4C28C20: malloc (vg_replace_malloc.c:296)
==2931==    by 0x4F7C003: caffe::SyncedMemory::mutable_cpu_data() (in ~/caffe/.build_release/lib/libcaffe.so)
==2931==    by 0x4F7CAA1: caffe::Blob<float>::mutable_cpu_data() (in ~/caffe/.build_release/lib/libcaffe.so)
==2931==    by 0x4FF3678: caffe::ConvolutionLayer<float>::Forward_cpu(std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&, std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&) (in ~/caffe/.build_release/lib/libcaffe.so)
==2931==    by 0x504B719: caffe::Net<float>::ForwardFromTo(int, int) (in ~/caffe/.build_release/lib/libcaffe.so)
==2931==    by 0x504BA86: caffe::Net<float>::ForwardPrefilled(float*) (in ~/caffe/.build_release/lib/libcaffe.so)
==2931==    by 0x502D389: caffe::Solver<float>::Test(int) (in ~/caffe/.build_release/lib/libcaffe.so)
==2931==    by 0x502DAA5: caffe::Solver<float>::TestAll() (in ~/caffe/.build_release/lib/libcaffe.so)
==2931==    by 0x50375B3: caffe::Solver<float>::Step(int) (in ~/caffe/.build_release/lib/libcaffe.so)
==2931==    by 0x5037FEE: caffe::Solver<float>::Solve(char const*) (in ~/caffe/.build_release/lib/libcaffe.so)
==2931==    by 0x407D94: train() (in ~/caffe/.build_release/tools/caffe.bin)
==2931==    by 0x4056A6: main (in ~/caffe/.build_release/tools/caffe.bin)

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

Successfully merging this pull request may close these issues.

None yet

1 participant