Skip to content

Fix a bug when re-assigning the same sample decoder to a task encoder through legacy args#149

Merged
voegtlel merged 1 commit intodevelopfrom
feature/fix_taskencoder_multi_use
Jul 2, 2025
Merged

Fix a bug when re-assigning the same sample decoder to a task encoder through legacy args#149
voegtlel merged 1 commit intodevelopfrom
feature/fix_taskencoder_multi_use

Conversation

@philipp-fischer
Copy link
Copy Markdown
Collaborator

Fixes a bug that can occur when using a task encoder as shown below.
The error message would be AssertionError: Task encoder already has a decoder, and setting using deprecated kwargs is not allowed.

Example:

te = MyTaskEncoder()

dataset = get_train_dataset(
    path="./metadat2.yaml",
    ...
    task_encoder=te,
    image_decode="pil",
)

val_dataset = get_val_dataset(
    path="./metadat3.yaml",
    ...
    task_encoder=te,
    image_decode="pil",
)

@philipp-fischer philipp-fischer requested a review from voegtlel July 2, 2025 07:03
@voegtlel voegtlel merged commit 57999f3 into develop Jul 2, 2025
8 checks passed
@voegtlel voegtlel deleted the feature/fix_taskencoder_multi_use branch July 2, 2025 07:30
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 this pull request may close these issues.

2 participants