Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Predict on CPU #15

Open
lynguyenminh opened this issue Feb 18, 2023 · 1 comment
Open

Predict on CPU #15

lynguyenminh opened this issue Feb 18, 2023 · 1 comment

Comments

@lynguyenminh
Copy link

Hi,
I am presently utilizing this repository to anticipate the text's location. However, an error occurs when I attempt to predict on the CPU because I do not have a GPU.

[02/18 23:18:40 detectron2]: Arguments: Namespace(confidence_threshold=0.5, config_file='configs/BAText/VinText/attn_R_50.yaml', input=['sample_input/'], opts=['MODEL.WEIGHTS', 'model_0033999.pth'], output='sample_output/', video_input=None, webcam=False)
WARNING [02/18 23:18:40 d2.config.compat]: Config 'configs/BAText/VinText/attn_R_50.yaml' has no VERSION. Assuming it to be compatible with latest v2.
Traceback (most recent call last):
File "demo/demo.py", line 74, in
demo = VisualizationDemo(cfg)
File "/home/lynguyenminh/Workspace/Projects/dict-guided/dict-guided/demo/predictor.py", line 36, in init
self.predictor = DefaultPredictor(cfg)
File "/home/lynguyenminh/Workspace/Projects/dict-guided/venv/lib/python3.8/site-packages/detectron2/engine/defaults.py", line 282, in init
self.model = build_model(self.cfg)
File "/home/lynguyenminh/Workspace/Projects/dict-guided/venv/lib/python3.8/site-packages/detectron2/modeling/meta_arch/build.py", line 23, in build_model
model.to(torch.device(cfg.MODEL.DEVICE))
File "/home/lynguyenminh/Workspace/Projects/dict-guided/venv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 899, in to
return self._apply(convert)
File "/home/lynguyenminh/Workspace/Projects/dict-guided/venv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 570, in _apply
module._apply(fn)
File "/home/lynguyenminh/Workspace/Projects/dict-guided/venv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 570, in _apply
module._apply(fn)
File "/home/lynguyenminh/Workspace/Projects/dict-guided/venv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 593, in _apply
param_applied = fn(param)
File "/home/lynguyenminh/Workspace/Projects/dict-guided/venv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 897, in convert
return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
File "/home/lynguyenminh/Workspace/Projects/dict-guided/venv/lib/python3.8/site-packages/torch/cuda/init.py", line 214, in _lazy_init
torch._C._cuda_init()
RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx

Is it support prediction in CPU?

@doanthuyennt
Copy link

Hello @lynguyenminh, I think your problem is related to #5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants