how to make train.txt file in caffe

浪尽此生 提交于 2019-12-23 04:57:08

问题


I am using caffe net with python. I have train.txt file like this:

   train/1175-c/b0a1.bmp b0a1
   train/1175-c/b0a2.bmp b0a2
   train/1175-c/b0a3.bmp b0a3
   train/1175-c/b0a4.bmp b0a4
   train/1175-c/b0a5.bmp b0a5
   train/1175-c/b0a6.bmp b0a6
   train/1175-c/b0a7.bmp b0a7
   train/1175-c/b0a8.bmp b0a8
   train/1175-c/b0a9.bmp b0a9
   train/1175-c/b0aa.bmp b0aa

my questions:

  1. Can I use hex instead of int at the end of each line?

  2. About the label, does it need to start from 0

Or Should I change the above to:

train/1175-c/b0a1.bmp 45217
train/1175-c/b0a2.bmp 45218
train/1175-c/b0a3.bmp 45219
train/1175-c/b0a4.bmp 45220
train/1175-c/b0a5.bmp 45221
train/1175-c/b0a6.bmp 45222
train/1175-c/b0a7.bmp 45223
train/1175-c/b0a8.bmp 45224
train/1175-c/b0a9.bmp 45225
train/1175-c/b0aa.bmp 45226

回答1:


If you are using this train.txt list as input for convert_imageset or as source for "ImageData" layer then the second part of each line must be a numeric label.
The labels must start with 0 since they are used as indices into the predicted probability vectors when computing loss and accuracy. See this thread for more information.



来源:https://stackoverflow.com/questions/41586449/how-to-make-train-txt-file-in-caffe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!