google-research / pix2seq

Pix2Seq codebase: multi-tasks with generative modeling (autoregressive and diffusion)
Apache License 2.0
857 stars 71 forks source link

ValueError: coco_object_detection not registered! #40

Closed mimichu closed 1 year ago

mimichu commented 1 year ago

Hi! I encountered the titled error when trying to evaluate the released object detection models following the provided command: python3 run.py --mode=eval --model_dir=</tmp/model_dir> --config=configs/config_det_finetune.py --config.dataset.coco_annotations_dir=</path/to/annotations> --config.eval.batch_size=40 with released fine-tuned checkpoint corresonding to encoder_variant, image_size in config_det_finetune.py downloaded into </tmp/model_dir/>.

Any pointers would be greatly appreciated! Thanks!

chentingpc commented 1 year ago

coco_object_detection should be registered at https://github.com/google-research/pix2seq/blob/eabd4e98f65f7627a0e727d11a4b9cbba916283d/metrics/coco_metrics.py#L316 when it is first called in run.py at https://github.com/google-research/pix2seq/blob/eabd4e98f65f7627a0e727d11a4b9cbba916283d/run.py#L34

can you double check if the register function above is called?

mimichu commented 1 year ago

Thanks for the quick response and the helpful pointer! Yeah, I commented out line 34 because of the # pylint: disable=unused-import comment. Uncommenting that line solves the issue!