Skip to content
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

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

Open
GeorgePearse opened this issue Jun 5, 2024 · 7 comments · May be fixed by #11870
Open

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

GeorgePearse opened this issue Jun 5, 2024 · 7 comments · May be fixed by #11870
Assignees

Comments

@GeorgePearse
Copy link

GeorgePearse commented Jun 5, 2024

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 GeorgePearse changed the title I don't think the albumentations pipeline is working img_path is not in available keys when running albumentations pipeline Jun 5, 2024
@GeorgePearse
Copy link
Author

Changed the version to 1.3.1 and it worked

@Theelx
Copy link

Theelx commented Jun 28, 2024

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
Copy link
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
Copy link
Author

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

#11432

@Theelx
Copy link

Theelx commented Jul 22, 2024

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
Copy link

Theelx commented Jul 22, 2024

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
Copy link

Theelx commented Jul 22, 2024

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 added a commit to Theelx/mmdetection that referenced this issue Jul 22, 2024
This commit introduces very basic version parsing for albumentations in order to know whether the strict parameter for albu.Compose is supported, and passes strict=False if it is. If it isn't supported, fall back to not passing the strict parameter, which only works on albu <= 1.4.6.
@Theelx Theelx linked a pull request Jul 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants