These are chat archives for beniz/deepdetect

17th
May 2016
Tim Patrick
@sudoawesomeness
May 17 2016 13:23
I want to train images of dimension '270*422' using resnet_50. How to do that and how much ram will be required approximately?
Emmanuel Benazera
@beniz
May 17 2016 13:36
@sudoawesomeness hi, my understanding is that resnet_50 takes 224x224 as entry but you may try with different input size and see how it goes (it should be fine). You can also use the crop:true parameter from the API that will proceeds with random 224x224 crops from your 270x422 images.
As for required memory, it depends on the batch size mostly. On a 12GB GPU you should be able to reach a batch size somewhere between 24 and 64. In the end you really need to try and see how it goes (it'd fail if your GPU memory is overloaded).
Tim Patrick
@sudoawesomeness
May 17 2016 14:06
@beniz thanks. I want to train on the whole image, not on a cropped version. If I modify the dimensions in deploy.prototxt and resnet_50.prototxt and comment the 'crop_size: 224' line, will it do the trick? Also will it work on a lower ram by decreasing the batch_size?
Ken Chen
@ken-talkingsource
May 17 2016 14:16

I fallowed this tutorial http://www.deepdetect.com/tutorials/imagenet-classifier/ step by step and when I $ curl -X PUT "http://localhost:8080/services/imageserv" -d "{\"mllib\":\"caffe\",\"description\":\"image classification service\",\"type\":\"supervised\",\"parameters\":{\"input\":{\"connector\":\"image\"},\"mllib\":{\"template\":\"googlenet\",\"nclasses\":1000}},\"model\":{\"templates\":\"../templates/caffe/\",\"repository\":\"../../models/imgnet\"}}"

I got this err :
service creation mllib bad param: failed to locate model template templates/caffe/googlenet/.prototxt

Which step I may have entered the wrong ?

Emmanuel Benazera
@beniz
May 17 2016 15:33
@sudoawesomeness tha API has support for image width and height, look it up.
Tim Patrick
@sudoawesomeness
May 17 2016 15:43
@beniz I tried putting height and width in input object of PUT and POST call, but it was giving me 'Check failed (custom): (datum_height) == (height)' error.
Emmanuel Benazera
@beniz
May 17 2016 15:48
Are you using a pre trained net?
Emmanuel Benazera
@beniz
May 17 2016 16:03
@ken-talkingsource I've just tried it by hand, just in case, and you must be doing something wrong. Typically, modify templates so that it points to /path/to/deepdetect/templates/caffe
Emmanuel Benazera
@beniz
May 17 2016 16:17
@sudoawesomeness can you share your service creation and training call by any chance, I will try on one of our machines. I don't believe we've played with different image sizes that much.
Tim Patrick
@sudoawesomeness
May 17 2016 16:49

curl -X PUT "http://localhost:8080/services/resnet" -d "{\"mllib\":\"caffe\",\"description\":\"L0 Resnet 50 classification service\",\"type\":\"supervised\",\"parameters\":{\"input\":{\"connector\":\"image\",\"width\":270,\"height\":422,\"bw\":true},\"mllib\":{\"template\":\"resnet_50\",\"nclasses\":4}},\"model\":{\"templates\":\"../templates/caffe/\",\"repository\":\"/home/usr/models/resnet\"}}"

curl -X POST "http://localhost:8080/train" -d "{\"service\":\"resnet\",\"async\":true,\"parameters\":{\"mllib\":{\"gpu\":false,\"net\":{\"batch_size\":16},\"solver\":{\"test_interval\":500,\"iterations\":1,\"base_lr\":0.001,\"stepsize\":1000,\"gamma\":0.9}},\"input\":{\"connector\":\"image\",\"test_split\":0.1,\"shuffle\":true,\"width\":270,\"bw\":true,\"height\":422},\"output\":{\"measure\":[\"acc\",\"mcll\",\"f1\"]}},\"data\":[\"/home/usr/training_data\"]}"

Emmanuel Benazera
@beniz
May 17 2016 16:58
thanks, will look at it and get back to you
Emmanuel Benazera
@beniz
May 17 2016 19:16
@sudoawesomeness I got it to work, and I believe you've found a glitch in our handling of crop_size. Here is how to proceed: edit templates/caffe/resnet_50/resnet_50.prototxt and remove thecrop_size: 224line. Go to yourbuildrepository and do thecmake ..again. Now apply thePUT /servicesandPOST /train` commands.
@sudoawesomeness though beware your training call has gpu:false, you definitely won't be able to train a resnet_50 in a realistic time on a CPU.
Emmanuel Benazera
@beniz
May 17 2016 20:12
fixed by beniz/deepdetect#131