NVIDIA / gpu-rest-engine

A REST API for Caffe using Docker and Go
BSD 3-Clause "New" or "Revised" License
421 stars 94 forks source link

Response from GRE is sometimes incomplete #26

Closed rperdon closed 6 years ago

rperdon commented 6 years ago

I wrote a python script to call the http server based off the curl xpost command you indicated in the instructions.

When I test a file, sometimes I will get a complete classification:

S:\images\Hei1.png http://10.4.10.116:9999/api/classify1 [{"confidence":0.5536,"label":"1 Non-anime"},{"confidence":0.4464,"label":"0 Ani "}] <Response [200]>

and on some files I will get an incomplete response:

S:\images\index.jpg http://10.4.10.116:9999/api/classify1 "},{"confidence":0.0023,"label":"1 Non-anime"}] <Response [200]>

I've tested different files, jpg and png and can't find a reason why some will get complete classifications, and others will get only half.

The server is not reporting any errors when classifying the files.

2017/12/20 20:16:51 Initializing Caffe classifiers 2017/12/20 20:16:51 0x13935c0 2017/12/20 20:16:54 Adding REST endpoint /api/classify1 2017/12/20 20:16:54 Starting server listening on :8000

I ran this command from this site to test for error/warning files, nothing seemed like a problem from my test images folder.

https://watson-net.com/blog/checking-the-integrity-of-all-jpg-files-in-a-directory/

I discovered the problem is with the output json information:

When I included the strict=False, I was able to print out the complete information. It appears as though there are carriage returns within the returned json information.

flx42 commented 6 years ago

Are you sure it's not your label file that has carriage returns?

rperdon commented 6 years ago

I was able to retrieve the info correctly with the strict=False parameter.

I just found it odd it work properly on some files and not others.