from a script on preparing data for a caffe network, the following piece of code turns an image (numpy array representing an image) into a datum object.
datum = caffe_pb2.Datum(
channels=3,
width=224,
height=224,
label=label,
data=np.rollaxis(img, 2).tostring())
If the network were unsupervised, do you just create the object the same way but do not fill the label parameter, as shown below?
datum = caffe_pb2.Datum(
channels=3,
width=224,
height=224,
data=np.rollaxis(img, 2).tostring())
The
label
ofDatum
isoptional
:Meaning oyu do not have to provide it.
Side note:
Datum
is a data structure used mainly for"Data"
input layer and strictly speaking it is not part of the trained net.Caffe uses N-D tensors
Blobs
to store both data and parameters of the net.