These are chat archives for beniz/deepdetect

23rd
May 2016
deter3
@deter3
May 23 2016 20:20
@beniz I have tried curl with curl -X POST "http://localhost:8080/predict" -d "{\"service\":\"imagesearch\",\"parameters\":{\"input\":{\"width\":224,\"height\":224},\"output\":{\"best\":3,\"binarized\":false}},\"data\":[\"http://i.ytimg.com/vi/0vxOhd4qlnA/maxresdefault.jpg\"] , \"mllib\":{\"gpu\":false,\"extract_layer\":\"loss3/classifier\"}}" , got the error "{"status":{"code":500,"msg":"InternalError","dd_code":1007,"dd_msg":"in get()"}}"
@beniz This is from Image similary search demo .
Emmanuel Benazera
@beniz
May 23 2016 20:24
thanks
the call should be exactly the same as by the python script
there's an almost exact match between the python dicts parameters_mllib etc... and the JSOn
here is a call that works: curl -X POST "http://localhost:8080/predict" -d "{\"service\":\"imgserv\",\"parameters\":{\"input\":{\"width\":224,\"height\":224},\"mllib\":{\"gpu\":false,\"extract_layer\":\"loss3/classifier\"},\"output\":{\"best\":3,\"binarized\":false}},\"data\":[\"http://i.ytimg.com/vi/0vxOhd4qlnA/maxresdefault.jpg\"]}"
read the doc as they say...
deter3
@deter3
May 23 2016 20:30
your json code is working .
Then I guess it should something wrong with imagesearch.py
Emmanuel Benazera
@beniz
May 23 2016 20:31
with your modifications somehow. script works fine here.
deter3
@deter3
May 23 2016 20:32
tried "python imgsearch.py --index /home/ubuntu/deepdetect/image_search_model/image_2_index --index-batch-size 1 " , same error . I am double checking py file .
Emmanuel Benazera
@beniz
May 23 2016 20:32
you can print the calls, and there's also a debug option in dd_client.py if you really need to look at calls more closely.
deter3
@deter3
May 23 2016 20:42
@beniz I got the prediction call with response of "{u'status': {u'msg': u'InternalError', u'dd_msg': u'src/caffe/data_transformer.cpp:177 / Check failed (custom): (datum_height) == (height)', u'code': 500, u'dd_code': 1007}}"
is it image size issue ?
deter3
@deter3
May 23 2016 20:53
resized the image , got the same error .
Emmanuel Benazera
@beniz
May 23 2016 21:02
try setting the width and height as in the JSON call
it is straightforward to report theJSON call into python
and post an excertp of the curl POST call output
deter3
@deter3
May 23 2016 21:16
I changed something in the script ; # reset call params

parameters_input = {} , comment out , then change bath_size from 1 to 2 in command line and deploy.prototxt , now seems like indexing the pictures . batch_size can not be 1 , otherwise p['val'] will have type error

sorry for the bold fronts , I did not what I did wrong .
Emmanuel Benazera
@beniz
May 23 2016 21:20
from what you are saying of batch size, my hunch is that some of the images you are passing to the program cannot be processed
this would explain the errors
if all images in a batch fail (likely with batch_size=1) then the predict will report failure
otherwise it is reported per image
deter3
@deter3
May 23 2016 21:22
prediction came back with result , just p['val'] is not working . I check details of p , it's list with 1000 items.
Now , index is finished , had a index.ann file .
Emmanuel Benazera
@beniz
May 23 2016 21:40
check your images and add error handling code around the predict call, this will show you what images are triggeringerrors
deter3
@deter3
May 23 2016 21:42
cool , I will . thanks a lot for your patience and great tool !
one more thing , in you demo , imagesearch.py , there is one line , parameters_input = {} which is reset after service put , in my situation , there is no need for this line since i need pass parameters_input to predict call , otherwise I can not get the result . can you let me know why you need to reset the parameters_input to empty in your script .
Emmanuel Benazera
@beniz
May 23 2016 22:06
setting the width and height at service creation time sets them as default
resetting the input connector is just my own good practice in a way
thanks for the update tothe issue btw
again some of your images may be broken or gif
thus explaining the error
deter3
@deter3
May 23 2016 22:13
cool! thanks again !