google-research-datasets / hiertext

The HierText dataset contains ~12k images from the Open Images dataset v6 with large amount of text entities. We provide word, line and paragraph level annotations.
Creative Commons Attribution Share Alike 4.0 International
261 stars 23 forks source link

Unified Detector, Error Message during Inference #5

Closed Bozcomlekci closed 2 years ago

Bozcomlekci commented 2 years ago

Greetings,

I'm trying to perform inference on the HierText dataset with Unified Detector. When I ran the inference script, I got the error message in the image.

The script I ran was:

python3 -m official.projects.unified_detector.run_inference \
--gin_file=official/projects/unified_detector/configs/gin_files/unified_detector_model.gin \
--ckpt_path=vision_unified_detector_unified_detector_ckpt \
--img_dir=<the-directory-containing-validation-images> \
--output_path=<some-directory>/validation_output.jsonl

The error message: error_message

I'm utilizing an anaconda environment with Python3.7.13. Initially, I ran the scripts under the sections, "Set up TensorFlow Models" and "Set up DeepLab2". I installed protoc with conda. Finally, I downloaded the Unified-Detector-Line checkpoint file, decompressed the file with gzip, moved it to the "models" folder and ran the script above.

Could you help with the error message? I suspect that there is a mismatch in the packages installed, or the checkpoint file is broken.

Could you also specify which python version you are using the Unified Detector with?

Thanks in advance.

Jyouhou commented 2 years ago

You need to specify the checkpoint up to the prefix of the files:

--ckpt_path=vision_unified_detector_unified_detector_ckpt/ckpt

Bozcomlekci commented 2 years ago

Thanks, the problem was the extension of the downloaded checkpoint file is .gz but it has to be .tar.gz to extract it. I had to manually change it to .tar.gz, then extract it. Although it is a small issue, it is confusing.