GithubHelp home page GithubHelp logo

Comments (8)

beniz avatar beniz commented on June 17, 2024

hey, thanks for catching this unfortunate regression again. The parallel loop should now be fixed wrt exceptions and there's a dedicated unit test to avoid further regressions. Let me know if it fixes your issue.

from deepdetect.

yhenon avatar yhenon commented on June 17, 2024

Hi - this appears to fix the issue for all my test cases - I'll go ahead and close it. Thanks for your help.

from deepdetect.

yhenon avatar yhenon commented on June 17, 2024

Hey - thanks again for your work here, but I think I'll go ahead and reopen this as I'm encountering another crash (tell me if you'd rather I open a new issue).

This one is proving to be tricky to reproduce, but the issue seems to be cURL timing out on HTTPS requests leading to an unhandled exception in deepdetect. However the curl request seems to be fine most of the time, the timeout only occurs sometimes.

curl -X POST "host.com:8080/predict" -d "{\"service\":\"imgnet\",\"parameters\":{\"input\":{\"width\":224,\"height\":224},\"output\":{\"best\":5}},\"data\":[\"https://scontent.cdninstagram.com/hphotos-xaf1/t51.2885-15/e15/11236339_839225329503090_301378127_n.jpg\"]}"

ERROR - service imgnet mllib bad param: Operation timed out after 0 milliseconds with 0 out of 0 bytes received
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> >'
what():  remote_endpoint: Transport endpoint is not connected

The strange curl message seems to be something others encounter(see here: http://stackoverflow.com/questions/22485811/curl-operation-timed-out-after-0-milliseconds )

from deepdetect.

beniz avatar beniz commented on June 17, 2024

Thanks for the detailed report. As you guessed, I am unable to easily reproduce. However, you should be able to test the potential fix you are pointing to, by modifying src/utils/httpclient.hpp such that the new options can be passed to the curl wrapper used in get_call:

request.setOpt(curlpp::options::Url(url));
request.setOpt(curlpp::options::SslVerifyPeer(false));
request.setOpt(curlpp::options::SslVerifyHost(false));
request.setOpt(curlpp::options::SslVersion(3));

If you could also try various combinations of these options, I am interested in the results. Typically, the version 3 of SSL is considered unsecure so it does feel a bad idea to force it here.

That being said, the Web is a wild wild world, it is very likely that some broken or atypical server out there breaks dd calls, though it is expected that all situations will eventually get covered. If you are dealing with lots of content directly coming from the Web, I am making the suggestion that you first retrieve content with some dedicated tool (e.g. scrapy), store it temporarily and pass it on to dd. That would probably give you the two benefits of being more robust to the outside world, and limiting recurrent calls to useless or broken resources.

I am keeping this ticket open to gather all retrieval glitches then, and to fix them as they come.

from deepdetect.

beniz avatar beniz commented on June 17, 2024

@yhenon the fix above catches exceptions around the curl calls, though in your case it will not retrieve the image, assuming it is possible to so.

from deepdetect.

yhenon avatar yhenon commented on June 17, 2024

Thanks, the catch around the curl call seems to solve the issue. I'm not 100% clear on when curlpp throws an exception - but I think we can agree that failing to retrieve the image is significantly better than deepdetect exiting.

I do see your point though - I might move to a pipeline where I curl the image -> upload to S3 -> query with deepdetect, although this adds quite a bit of latency for the end-user.

Thanks again, I'll leave this open even though I'm not aware of any crashes with image retrieval currently.

from deepdetect.

beniz avatar beniz commented on June 17, 2024

we can agree that failing to retrieve the image is significantly better than deepdetect exiting.

Definitely!

I might move to a pipeline where I curl the image -> upload to S3 -> query with deepdetect, although this adds quite a bit of latency for the end-user.

There's support for passing images in base64 format, that comes with an encoding size overhead of course. Also, using batches wherever you can (and with GPU when possible) should yield best performance.

from deepdetect.

beniz avatar beniz commented on June 17, 2024

Beware of #68 and pull out the fix if using multiple images prediction at once.

from deepdetect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.