question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could you make the code non-CUDA compliant?

See original GitHub issue

Hi. It seems that the code is only working with a GPU. I get an error when I try to lauch the demo:

1  $  python demo.py Traceback (most recent call last): File “demo.py”, line 14, in <module> MORAN = MORAN(1, len(alphabet.split('😂), 256, 32, 100, BidirDecoder=True) File “/Users/sebastienvincent/serjee/scene_text/MORAN_v2/models/moran.py”, line 11, in init self.MORN = MORN(nc, targetH, targetW, inputDataType, maxBatch) File “/Users/sebastienvincent/serjee/scene_text/MORAN_v2/models/morn.py”, line 37, in init grid = torch.from_numpy(grid).type(self.inputDataType).cuda() File “/Users/sebastienvincent/.virtualenvs/moran/lib/python2.7/site-packages/torch/_utils.py”, line 38, in type return new_type(self.size()).copy(self, async) File “/Users/sebastienvincent/.virtualenvs/moran/lib/python2.7/site-packages/torch/cuda/init.py”, line 384, in _lazy_new _lazy_init() File “/Users/sebastienvincent/.virtualenvs/moran/lib/python2.7/site-packages/torch/cuda/init.py”, line 141, in _lazy_init _check_driver() File “/Users/sebastienvincent/.virtualenvs/moran/lib/python2.7/site-packages/torch/cuda/init.py”, line 55, in _check_driver raise AssertionError(“Torch not compiled with CUDA enabled”) AssertionError: Torch not compiled with CUDA enabled

Indeed, the file L37 of MORAN_v2/models/morn.py mentions grid = torch.from_numpy(grid).type(self.inputDataType).cuda() which works only if you have a CUDA system with a GPU.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
happogcommented, Jan 17, 2019

I have adjusted the code to support cpu inferece, you can ref to: https://github.com/happog/object_rect_attention.git

1reaction
Canjie-Luocommented, Jan 17, 2019

My teammate found an non-GPU device and developed an non-CUDA demo for you. https://github.com/Canjie-Luo/MORAN_v2/tree/demo_cpu

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can the program compiled with NVCC run a machine without ...
Yes if you want to run GPU code, you have to have a suitable GPU with drivers. The .cu code built with CUDA...
Read more >
Can I compile a cuda program without having a cuda device
The answer to your question is YES. The nvcc compiler driver is not related to the physical presence of a device, so you...
Read more >
Compile a CUDA compatible version on a non CUDA computer?
Can I compile a cuda compatible version of pytorch on a machine with no GPUs available? ... But when I run torch.cuda.is_available() in...
Read more >
CUDA vs OpenCL: Which One For GPU Programming?
CUDA vs OpenCL - two interfaces used in GPU computing and while they both present some similar features, they do so using different ......
Read more >
Trying to run it locally on a non-CUDA gpu or just CPU #26
Do I need to run the code manually for each, or can the code take care of it? The demo script processes all...
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