Closed YaYaB closed 5 years ago
Hi, thanks.
I believe absolute paths are a requirement, otherwise the only known path to the system is the one the dede
process has been started from, not very practical and error prone. Though let us know whether it'd be useful in some situations.
std
parameter is standard deviation in pixels, so it should be an int
. There are parameters for which we give some slack by doing the conversion internally. Let us know whether this could be useful here.
we'll fix best: -1
as it should return all classes indeed.
Hello, Thanks for the quick reply.
* [here](https://pytorch.org/docs/stable/torchvision/models.html) you can see that the std vector is composed of floats
Note that these values assume input values are in [0,1] before normalization, which is not the case here, they need to be scaled back with a factor 255.
Yes, no problem on that. However when you normalize using std, your int will become float anyway so I don't see the point keeping as an it. Moroever even if caffe deploy.prototxt you have float means ^^ Here https://github.com/jolibrain/deepdetect/blob/master/src/backends/torch/torchinputconns.h#L108 you divide the image by the std obtaining an image of floats. Forcing std to int (meaning that you truncate or round the real value of the std) makes you only lose precision in your normalization.
See #611 changes with the introduction of scale
, and std
has been moved to a vector of float
/double
.
Closing for now as solved on our side. Thanks for digging into these issues!
It was #661 and not #611. Moreover, it is not yet merged, is it?
Configuration
Master
, 7512943bd830967c9c97f0780658d8e811c81c4dYour question / the problem you're facing:
I have seen weird use of some input in the prediction request for pytorch models.
Error message (if any) / steps to reproduce the problem:
Let's do as the #611 suggest: Download model
Run dede Start the service
It will fail wit the following error
However it works well if I put the absolute path to the model.
When the service is correctly launched I have the same issue with the data to predict. Run predict to guess the class of an image
It will fail with the following error if the path is not absolute.
When the path is set as absolute it works well an I got the following result:
Now, once again if a modify the request and change for instance the std from float to int like the following
{"status":{"code":500,"msg":"InternalError","dd_code":1007,"dd_msg":"in get()"}}%
{"status":{"code":200,"msg":"OK"},"head":{"method":"/predict","service":"torch_resnet","time":125.0},"body":{"predictions":[{"classes":[],"uri":"/PATHTO/resnet50_torch/cat.jpg"}]}}%