Closed kba closed 4 years ago
Except for dewarping (not possible w/o CUDA), every processor should at least run and produce output.
Great work!
For the record, could you identify what specifically is missing for CPU fallback in dewarping? I remember @VChristlein gave us the following advice:
This is how the test_dewarp.py
test fails for me w/o the CUDA check skip:
/home/kba/build/github.com/OCR-D/monorepo/ocrd_all/ocrd_anybaseocr/tests/test_dewarp.py:32:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/kba/build/github.com/OCR-D/monorepo/ocrd_all/venv/local/sub-venv/headless-tf22/lib/python3.6/site-packages/ocrd/processor/base.py:61: in run_processor
processor.process()
/home/kba/build/github.com/OCR-D/monorepo/ocrd_all/ocrd_anybaseocr/ocrd_anybaseocr/cli/ocrd_anybaseocr_dewarp.py:152: in process
model, dataset, page, page_xywh, page_id, input_file, orig_img_size, n)
/home/kba/build/github.com/OCR-D/monorepo/ocrd_all/ocrd_anybaseocr/ocrd_anybaseocr/cli/ocrd_anybaseocr_dewarp.py:182: in _process_segment
data['label'], data['inst'], data['image'])
/home/kba/build/github.com/OCR-D/monorepo/ocrd_all/ocrd_anybaseocr/ocrd_anybaseocr/pix2pixhd/models/pix2pixHD_model.py:198: in inference
input_label, inst_map, real_image, _ = self.encode_input(Variable(label), Variable(inst), image, infer=True)
/home/kba/build/github.com/OCR-D/monorepo/ocrd_all/ocrd_anybaseocr/ocrd_anybaseocr/pix2pixhd/models/pix2pixHD_model.py:113: in encode_input
input_label = label_map.data.cuda()
/home/kba/build/github.com/OCR-D/monorepo/ocrd_all/venv/local/sub-venv/headless-tf22/lib/python3.6/site-packages/torch/cuda/__init__.py:186: in _lazy_init
_check_driver()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def _check_driver():
if not hasattr(torch._C, '_cuda_isDriverSufficient'):
raise AssertionError("Torch not compiled with CUDA enabled")
if not torch._C._cuda_isDriverSufficient():
if torch._C._cuda_getDriverVersion() == 0:
# found no NVIDIA driver on the system
raise AssertionError("""
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""")
E AssertionError:
E Found no NVIDIA driver on your system. Please check that you
E have an NVIDIA GPU and installed a driver from
E http://www.nvidia.com/Download/index.aspx
Except for dewarping (not possible w/o CUDA), every processor should at least run and produce output.