These are chat archives for beniz/deepdetect

7th
Sep 2016
Guy Brand
@Motherboard
Sep 07 2016 11:34

Hi, going over the REST API documentation, I couldn't wrap my head around the training message:
curl -X POST "http://localhost:8080/train" -d "{\"service\":\"covert\",\"async\":true,\"parameters\":{\"mllib\":{\"gpu\":true,\"solver\":{\"iterations\":1000,\"test_interval\":100},\"net\":{\"batch_size\":512}},\"input\":{\"label_offset\":-1,\"label\":\"Cover_Type\",\"id\":\"Id\",\"separator\":\",\",\"shuffle\":true,\"test_split\":0.1,\"scale\":true},\"output\":{\"measure\":[\"acc\",\"mcll\",\"f1\"]}},\"data\":[\"models/covert/train.csv\"]}"

It doesn't seem to include a path to models repository, what model is it using then?
It also seems the mlib does not specify caffe anywhere.. which I though was mandatory.

I wish to fine-tune a model which does not exist in the templates... I currently have a train.prototxt, test.prototxt and deploy.prototxt (which are pretty similar, except for the accuracy, loss, dropout, and data layers) and a .caffemodel file.

Do I just dump all of these into the model repository path? How does the solver know which model is for training and which is for testing? Or do I only provide the training model, and it infers the testing model from that?

Can you provide the JSON to use in this scenario?

Also, my Data layer points to an LMDB I've already created.. I could use a CSV instead, but then how does my Data layer should look? should it be an ImageData layer instead of a Data layer?
And is there an easy way to also include a validation set to run against automatically once the training is done?
Emmanuel Benazera
@beniz
Sep 07 2016 11:43
Your first set of questions is answered at service creation. Service defines model repository etc, not training.
if you have your own prototxt files, you may have to tweak them so that their inputs are compatible with DD. Just look at the Caffe templates in templates/caffe.
Guy Brand
@Motherboard
Sep 07 2016 13:35
Thanks, that makes it much clearer. In templates/caffe I've noticed there's a solver.prototxt as well as train+test net and a deploy net. does dd use the solver.prototxt in any way (for example if I don't provide a solver argument in the train json request?) Is it possible to use 2 separate nets for training and for testing, and provide for the solver a train_net and a test_net as is done in the latest caffe versions?
Emmanuel Benazera
@beniz
Sep 07 2016 14:03
Yes solver.prototxt is used and required, and when a parameter is not specified, dd has default value for it, built internally. No you can't use two separate nets, and I'd say it'd be actually very much error prone to do so. The deploy is used for prediction and final assessment over the test set.
Guy Brand
@Motherboard
Sep 07 2016 15:34
So, dd looks first for solver parameters in the request body, then looks at the solver.prototxt, and finally at the hard coded defaults? regarding the separation of the test and train nets - correct me if I'm wrong, but to my understanding in the BVLC\caffe master using one net has been deprecated - all of their tutorials now use two nets as far as I've seen..
hmm.. had a second look, and I think I'm wrong regarding the 2 nets thing...
Emmanuel Benazera
@beniz
Sep 07 2016 16:14
Yes, the parameters in the request body overwrite the others, then it should be the ones from solver.prototxt. And yes I believe the Caffe prototxt situation has remained the same, though Nvidia people from Digits are trying / willing to change that. The good reason to have the train and test net together is that it removes the ability to error at the transfer of trained weights. While having deploy.prototxt outside makes sense for distribution. My 2cents.