Giter Site home page Giter Site logo

Comments (6)

leopiney avatar leopiney commented on May 30, 2024 13

It happened to me when running some tools from the DensePose project that it always tried to compile the model using CUDA, which I don't have installed because I'm running some experiments on MacOS.

If you want to use CPU for inference you can add the option MODEL.DEVICE cpu to the command you are running, or add that same setting in the configuration file you are using:

MODEL:
  DEVICE: "cpu"

from detectron2.

kHarshit avatar kHarshit commented on May 30, 2024 3

I also have the same error on my MacOS, please how i can use the command MODEL.DEVICE cpu or where should i write to the config file , thank you!

Check https://detectron2.readthedocs.io/tutorials/getting_started.html#inference-with-pre-trained-models i.e. in order to run inference on cpu

python demo/demo.py --config-file configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml \
  --input input1.jpg input2.jpg \
  --opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl \
  MODEL.DEVICE cpu

If you're talking about the error build/temp.linux-x86_64-3.7/home/harshit/PycharmProjects/detectron2/detectron2/layers/csrc/vision.o: file not recognized: file format not recognized, then I solved it by downgrading binutils to 2.30-5.

from detectron2.

ppwwyyxx avatar ppwwyyxx commented on May 30, 2024

You can install detectron2 on CPU and run inference.

If you google the error message, all occurrences of the message suggest a bug in binutils / elfutils . You may need to upgrade / downgrade your system or compiler toolchain.

from detectron2.

kHarshit avatar kHarshit commented on May 30, 2024

Thanks, it worked after downgrading binutils.

from detectron2.

kHarshit avatar kHarshit commented on May 30, 2024

Thanks @leopiney, I was able to run it on CPU using the MODEL.DEVICE option.

from detectron2.

FlyEgle avatar FlyEgle commented on May 30, 2024

I also have the same error on my MacOS, please how i can use the command MODEL.DEVICE cpu or where should i write to the config file , thank you!

from detectron2.

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.