-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Failed to load json using detect.py #2086
Comments
It looks like the error is more about how it parses the JSON output file. |
Hi, from your call It looks like you might be missing the end Should be: Let me know if that works. |
No, still the same error. |
Is your target GCS bucket empty? |
I created a new folder in my bucket and targeted that folder and still received the error. |
Does it still throw an error if you use our example pdf? |
Yes, still same error. |
For the example pdf ( |
Here are the first 75 lines
|
Here are the three total files |
Alright, cool. It looks like the Vision API call is successful, but when retrieving the results from GCS there seems to be an issue. Are you on the latest version for the storage API? |
pip freeze | findstr google |
I updated google cloud storage to 1.15.0 but I still get the same error |
I had this issue and determined it was caused by the prefix being iterated as part of the bloblist. I can see that "output/" is listed as a file in your output, and subsequently has parsing attempted on it causing the error. Try hardcoding a prefix something like The demo code should probably be modified to handle this simple case a little better. |
@benbluhm your suggestion solved my issue, thank you |
Yes. It worked for me also. |
Thanks, @benbluhm! |
Hi Guys can someone put in the updated sample code. That would be great. \ Thanks |
In which file did you encounter the issue?
python-docs-samples/vision/cloud-client/detect/detect.py
Did you change the file? If so, how?
No.
Describe the issue
I tried using detect.py on a PDF that is stored in Google Cloud. Below is a sample of the code I tried
C:\temp1\google_vision>python detect.py ocr-uri gs://my_bucket_name/file_1003.pdf gs://my_bucket_name/output/
When I run my code I get the following error:
How can I avoid this error? There is a resulting JSON file in the output folder.
The text was updated successfully, but these errors were encountered: