Giter Site home page Giter Site logo

Runtime error about google_drive_ocr HOT 7 CLOSED

hrishikeshrt avatar hrishikeshrt commented on August 29, 2024
Runtime error

from google_drive_ocr.

Comments (7)

hrishikeshrt avatar hrishikeshrt commented on August 29, 2024

This is the same error as mentioned in #1
Please make sure you have installed the latest version.
You may have to run pip install --upgrade google-drive-ocr to get the latest version (0.2.5+)

from google_drive_ocr.

defencedog avatar defencedog commented on August 29, 2024

I have built via git clone... See the version is written above in the Runtime error

from google_drive_ocr.

hrishikeshrt avatar hrishikeshrt commented on August 29, 2024

Ah, my bad. I see that you have 0.2.5.
Although, in that case, I am unable to understand or reproduce the issue.
The variable extra does get set before it's accessed.
Could you paste the output of following,

grep extra data/data/com.termux/files/usr/lib/python3.10/site-packages/google_drive_ocr/application.py -C 5

from google_drive_ocr.

defencedog avatar defencedog commented on August 29, 2024

Here

.../site-packages/google_drive_ocr $ grep extra application.py -C 5                                        workload = file_count // workers
        if workers > 1:
            print(f"Total {file_count} files "
                  f"distributed among {workers} workers.")
            print(f"Workload: {workload}-{workload + 1} per worker")
            extra = file_count % workers

        worker_arguments = []
        _start = 0
        for idx in range(workers):
            _workload = workload + (idx < extra)
            worker_arguments.append({
                'worker_id': idx,
                'image_files': image_files[_start:_start+_workload],
                'disable_tqdm': disable_tqdm
            })

from google_drive_ocr.

hrishikeshrt avatar hrishikeshrt commented on August 29, 2024

This seems to be the older version of file still.
Check out the current version of the file in the repository.

workload, extra = divmod(file_count, workers)

Perhaps an uninstall and re-install of the package would fix it.

from google_drive_ocr.

defencedog avatar defencedog commented on August 29, 2024

Dear author I am literally sorry ...It's weird that today I upgraded pip & problem solved

google-ocr --config /storage/28E1-1BF4/GoogleOCR/gdo.cfg --pdf in.pdf
(PID:26799): 100%|███████████████████████████████████████████████████| 3/3 [00:20<00:00,  6.91s/it]
Total Time Taken: 20.81 seconds

from google_drive_ocr.

hrishikeshrt avatar hrishikeshrt commented on August 29, 2024

No need to be sorry :-)
I am glad the issue is resolved.

from google_drive_ocr.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.