Skip to content

FileNotFoundError in download_and_unzip when running multiple easyocr's concurrently #1335

@starpit

Description

@starpit

When we try to run two or more easyocr's concurrently, we get an error in the downloader. I am guessing that the download logic uses a fixed download filepath?

EasyOcrModel(
File ".../lib/python3.10/site-packages/docling/models self.reader = easyocr.Reader(config["lang"])
File ".../lib/python3.10/site-packages/easyocr/easyocr.py", line 92, in __init__
  detector_path = self.getDetectorPath(detect_network)
File ".../lib/python3.10/site-packages/easyocr/easyocr.py", line 253, in getDetectorPath
  download_and_unzip(self.detection_models[self.detect_network]['url'], self.detection_models[self.detect_network]['filename'], self.model_storage_directory, self.verbose)
File ".../lib/python3.10/site-packages/easyocr/utils.py", line 631, in download_and_unzip
  os.remove(zip_path)
FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/.EasyOCR//model/temp.zip'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions