Coder Social home page Coder Social logo

Comments (10)

praeclarumjj3 avatar praeclarumjj3 commented on May 20, 2024

Hi @jinfagang, thanks for your interest in our work. By default, we compile the code on a GPU machine. If you want to run on a CPU, you will need to make changes to two files:

  • oneformer/modeling/pixel_decoder/ops/functions/ms_deform_attn_func.py: find the changed file here

  • oneformer/modeling/pixel_decoder/ops/modules/ms_deform_attn.py: find the changed file here

After you change these two files, don't run sh make.sh as the CPU kernel uses pure PyTorch code. That should solve your issue.

from oneformer.

lucasjinreal avatar lucasjinreal commented on May 20, 2024

@praeclarumjj3 hello, why not just make it support out-ofbox? by simply judge on if torch.cuda.is_avaiable()?

from oneformer.

praeclarumjj3 avatar praeclarumjj3 commented on May 20, 2024

Thanks for your suggestion. I plan on doing that in a future commit.

from oneformer.

praeclarumjj3 avatar praeclarumjj3 commented on May 20, 2024

Hi @jinfagang, I have made the changes in the most recent commit. It should work for you now.

from oneformer.

lucasjinreal avatar lucasjinreal commented on May 20, 2024

@praeclarumjj3 hello, cpu got some error:

[11/16 12:55:08 detectron2]: ../../../images/COCO_val2014_000000001856.jpg: detected 1 instances in 15.87s
Traceback (most recent call last):
  File "/Ux/OneFormer/demo/demo.py", line 138, in <module>
    cv2.imshow(WINDOW_NAME, visualized_output.get_image()[:, :, ::-1])
AttributeError: 'dict' object has no attribute 'get_image'

from oneformer.

lucasjinreal avatar lucasjinreal commented on May 20, 2024

btw, 15s generated an image on CPU is quite slow..

from oneformer.

praeclarumjj3 avatar praeclarumjj3 commented on May 20, 2024

Can you try saving the output instead by specifying the --output path?

from oneformer.

praeclarumjj3 avatar praeclarumjj3 commented on May 20, 2024

btw, 15s generated an image on CPU is quite slow..

You are free to optimize the method. 15s seems fair to me, considering it's a large model, and I assume you must be running for the panoptic task. If yes, that gives you all three predictions, so it's 5 seconds per output.

from oneformer.

praeclarumjj3 avatar praeclarumjj3 commented on May 20, 2024

Feel free to re-open if you face any issues.

from oneformer.

hamedsteiner avatar hamedsteiner commented on May 20, 2024

Hi @praeclarumjj3 , about the changes to ms_deform_attn file to run on the CPU, can you share the links? They are not available.

from oneformer.

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.