Skip to content

img_path is not in available keys when running albumentations pipeline #11770

@GeorgePearse

Description

@GeorgePearse
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

Activity

changed the title [-]I don't think the albumentations pipeline is working[/-] [+]img_path is not in available keys when running albumentations pipeline[/+] on Jun 5, 2024
GeorgePearse

GeorgePearse commented on Jun 5, 2024

@GeorgePearse
Author

Changed the version to 1.3.1 and it worked

Theelx

Theelx commented on Jun 28, 2024

@Theelx

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.

GeorgePearse

GeorgePearse commented on Jul 22, 2024

@GeorgePearse
Author

@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

GeorgePearse commented on Jul 22, 2024

@GeorgePearse
Author

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

#11432

Theelx

Theelx commented on Jul 22, 2024

@Theelx

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

Theelx commented on Jul 22, 2024

@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

Theelx commented on Jul 22, 2024

@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.

added a commit that references this issue on Jul 22, 2024
linked a pull request that will close this issue on Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @jbwang1997@Theelx@GeorgePearse

    Issue actions

      img_path is not in available keys when running albumentations pipeline · Issue #11770 · open-mmlab/mmdetection