Could you make the code non-CUDA compliant?
See original GitHub issueHi. 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:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
I have adjusted the code to support cpu inferece, you can ref to: https://github.com/happog/object_rect_attention.git
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