Git Product home page Git Product logo

Comments (8)

ashkamath avatar ashkamath commented on August 30, 2024

yup, just pass --device=cpu

from mdetr.

AK391 avatar AK391 commented on August 30, 2024

@ashkamath thanks I am getting Your session crashed after using all available RAM in colab

from mdetr.

AK391 avatar AK391 commented on August 30, 2024

@ashkamath could be related to pass PIL.Image.Image instead of <class 'PIL.JpegImagePlugin.JpegImageFile'>?

from mdetr.

alcinos avatar alcinos commented on August 30, 2024

Hi @AK391
Did you try requesting an instance with more ram? I just tried doing inference on CPU in the colab and it worked fine.

Best of luck

from mdetr.

AK391 avatar AK391 commented on August 30, 2024

@alcinos yes that should work but wondering why this happens for some images and not others
I think it has to do with img = transform(im).unsqueeze(0).cpu()
in plot_inference

from mdetr.

alcinos avatar alcinos commented on August 30, 2024

Interesting, do you have an image where it consistently fails, starting from a fresh instance? (Note that in colab, there might be a lot of variables that stay in memory, progressively clogging it over time)

One thing that comes to mind is that your input image is too big. The line you are referring to is doing the pre-processing, namely resize such that the small size is 800 and the long size it at most 1333, followed by conversion to torch tensor and normalization. None of these operations should be particularly RAM heavy, unless the input image is huge or somehow malformed.

If that makes things easier, you could try to reduce a bit the inference size in the transform, like 600 instead of 800. This will incur a slight decrease in performance, especially for small objects, but should still otherwise work fine.

from mdetr.

AK391 avatar AK391 commented on August 30, 2024

@alcinos I tried the same image from the notebook but I downloaded it first as a png
download (10)

from mdetr.

AK391 avatar AK391 commented on August 30, 2024

@alcinos session still crashes at 600

from mdetr.

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.