I search the Caffe source code a bit, and the ReadImageToDatum function in caffe/src/caffe/util/io.cpp only supports int type labels.
I've also noticed that there's an array_to_datum function in caffe/python/caffe/io.py, which seems to not have the constraint on the type of label, but I'm not exactly sure how I'm supposed to use it. 
How can I use numerical (non-integers) labels for regression?