1

I am using pycaffe and my train and test data is in LMDB format.

I have created my net like this: net = caffe.Net('train.prototxt', 'c.caffemodel', caffe.TEST)

when you call net.forward, implicitly you walk through the LMDB test database one by one batches. My question is how can I start from the beginning of LMDB and test my network on the first n batches of the test data?

Thanks

ali khodadadi
  • 65
  • 1
  • 6

1 Answers1

0

not sure it still relevant but you would need to change the data of input layer ,something like this net.params['data'][0].data[...] =net.params['data'][0].data[n,:,:,:]

Eliethesaiyan
  • 2,327
  • 1
  • 22
  • 35
  • does lmdb input layer expos its internal data as layer.param? – Shai Jun 01 '17 at 04:21
  • @Shai,not sure...but isn't the point of interfaces?done that other layers but used pycaffe and matcaffe – Eliethesaiyan Jun 01 '17 at 07:46
  • usually `layer.params` stores the **trainable** parameters of the layer. I'm not sure how `"Data"` layer is implemented, but it doesn't seems like the data is stored as a layer's parameter. Have you verified this solution? – Shai Jun 01 '17 at 07:49
  • @Shai,sorry for the late reply,haven't worked on lmdb yet but considering that they are blobs,this would work,not tried on lmdb,but this working for me inet.params['data'][0].data[...]=numpyarray[samedim as network] – Eliethesaiyan Jun 07 '17 at 05:07