DINO inference on a CPU only machine fails

See original GitHub issue

Hi,

Always end up with this common error Cannot import detrex._C', therefore 'MultiScaleDeformableAttention' is not available.

Inference script with train.device and model.device = "cpu" works but it still requires a Cuda dependent/enabled machine.

Is there a way to bypass this? Is there a way to deploy/run DINO on a CPU only machine/docker?

Many thanks!

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:9

github_iconTop GitHub Comments

4reactions
powermanocommented, Dec 13, 2022

Just delete the following lines, and set train.device = "cpu" model.device = train.device. It works for me.

#try:
#    from detrex import _C
#except ImportError:
    # TODO: register ops natively so there is no need to import _C.
#    _msg = "detrex is not compiled successfully, please build following the instructions!"
#   _args = ("detrex._C", _msg)
#    MultiScaleDeformableAttention = create_dummy_class(  # noqa
#        "MultiScaleDeformableAttention", *_args
#    )
1reaction
rentainhecommented, Dec 4, 2022

Please check if you have set cuda runtime during installation, the MultiscaleDeformableAttention operator need to be built under cuda runtime, You can check this issue for the solution: #109 And the CPU inference problem will be checked later~

Thanks for your reply and yes, I totally understand the cuda runtime problem. I have trained a DINO model on a custom dataset and now trying to run it on a CPU-only machine. So now stuck on this error as there is no GPU available so cannot install CUDA Toolkit and was wondering if there is a way around it? I guess this is not possible currently?

Ok, I’ve totally understand your problem, we will check this problem later

Read more comments on GitHub >

github_iconTop Results From Across the Web

Frequently Asked Questions · Issue #109 - GitHub
Meet error when training DINO, Cannot import 'detrex. ... DINO inference on a CPU only machine fails #157.
Read more >
Common errors | DINO CPU Assignments - GitHub Pages
If you see the following error, it is likely because you ran out of disk space on the CSIF machine. FATAL: container creation...
Read more >
Facebook AI's DINO | PyTorch Code Explained - YouTube
JOIN OUR DISCORD COMMUNITY:Discord ▻ https://discord.gg/peBrCpheKE SUBSCRIBE TO MY MONTHLY AI NEWSLETTER:Substack ...
Read more >
AWS Sagemaker inference endpoint not utilizing all vCPUs
I have deployed a custom model on sagemaker inference endpoint (single instance) and while I was load testing, I have observed that CPU...
Read more >
You never get bored playing with Computer Vision
And if you wish you can make your machine to play a game. ... In my case I'm looking for only 1 Dino,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found