mmdetection icon indicating copy to clipboard operation
mmdetection copied to clipboard

img_path is not in available keys when running albumentations pipeline

Open GeorgePearse opened this issue 1 year ago • 7 comments

ValueError: Key img_path is not in available keys.
2024/06/05 15:33:54 INFO mlflow.system_metrics.system_metrics_monitor: Stopping system metrics monitoring...
2024/06/05 15:33:54 INFO mlflow.system_metrics.system_metrics_monitor: Successfully terminated system metrics monitoring!

I hit this bug when I run a pipeline which is almost identical to the example in configs/

mmcv==2.1.0
mmdeploy==1.3.1
mmdet==3.3.0
mmengine==0.10.4
albumentations==1.4.8

The actual error message is coming from albumentations' Compose class, not MMDetection.

Would be great if a version of albumentations was specified with https://github.com/open-mmlab/mmdetection/tree/cfd5d3a985b0249de009b67d04f37263e11cdf3d/configs/albu_example

GeorgePearse avatar Jun 05 '24 15:06 GeorgePearse

Changed the version to 1.3.1 and it worked

GeorgePearse avatar Jun 05 '24 15:06 GeorgePearse

Changed the version to 1.3.1 and it worked

Thanks so much, that was super helpful! I found that I needed a feature released after 1.3.1 though, and it turns out that the issue seems to have been introduced in 1.4.7, so any version below that should work.

Theelx avatar Jun 28 '24 15:06 Theelx

@Theelx thanks so much to you too. Looks like I now need that feature! Was just hitting a mysterious bug, and thought I'd try this. Working perfectly.

GeorgePearse avatar Jul 22 '24 07:07 GeorgePearse

There's also this fix for empty images that it took me a bit too long to discover.

https://github.com/open-mmlab/mmdetection/pull/11432

GeorgePearse avatar Jul 22 '24 08:07 GeorgePearse

There's also this fix for empty images that it took me a bit too long to discover.

#11432

Oh thanks lol, I never noticed that! I had been working around that by just setting a single pixel per class on the image in the corners, so that every mask had at least one pixel of every class, but this seems way better!

Theelx avatar Jul 22 '24 14:07 Theelx

Also, I believe 1.4.11 could work too if strict=False was passed to albumentations.Compose, as specified in the Core section of the 1.4.11 release notes, though I haven't tried it yet.

Theelx avatar Jul 22 '24 14:07 Theelx

Ok, I can confirm that passing strict=False to mmsegmentation's codebase's initialization of albumentations.Compose results in it working with mmdeploy, so I'd think the same would happen with mmdetection.

Theelx avatar Jul 22 '24 14:07 Theelx