[Fix] Handle extensionless MLflow image names - #1690
Open
ShreyanshGoyal wants to merge 1 commit into
Open
ShreyanshGoyal wants to merge 1 commit into
ShreyanshGoyal wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
MLflowVisBackend.add_imageforwards itsnamedirectly tomlflow.log_image. Visualization hooks commonly use extensionless identifiers such asval_img, and MLflow passes that name to Pillow, which raisesValueError: unknown file extension.Fixes #1681.
Modification
<name>_<step>.pngbefore calling MLflow.BC-breaking
No. Explicit filenames such as
img.pngare unchanged. Names that previously failed now log successfully as PNG artifacts.Testing
ValueError: unknown file extension.pytest tests/test_visualizer/test_vis_backend.py::TestMLflowVisBackend::test_add_image -q(1 passed)pytest tests/test_visualizer/test_vis_backend.py -q -k 'not TestDVCLiveVisBackend and not TestAimVisBackend'(36 passed, 7 skipped, 14 deselected)pre-commit run --files mmengine/visualization/vis_backend.py tests/test_visualizer/test_vis_backend.py(all hooks passed)The Aim and DVCLive classes were deselected because those optional dependencies are not installed; the same pre-change run failed only in those two classes for missing packages.
Checklist