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

Handling source ordering #20

Closed
csteinmetz1 opened this issue Feb 3, 2023 · 4 comments
Closed

Handling source ordering #20

csteinmetz1 opened this issue Feb 3, 2023 · 4 comments

Comments

@csteinmetz1
Copy link
Collaborator

Seeing some weirdness in how source ordering is handled. In cfg/hdemucs.yaml we can define the ordering. However, there are also defaults defined in utils/__init__.py. In the lightning module seems like it uses the ordering from the defaults. I saw this behavior when I loaded only the base model from the checkpoint and not the lightning module, which resulted in the ordering of the source labels being swapped.

Thoughts on the best way to handle source ordering so we don't have it defined in multiple places?

@yoyolicoris
Copy link
Member

The source ordering in the config is meaningless, because of the sorting operation inside lightning model.
https://github.com/yoyololicon/mdx23-aim-playground/blob/f3ffa7e7bb3831410077a77db2b702b69cc08332/lightning/waveform.py#L35
You can imagine the sources as a set, not a list.
The order always follows the one defined in utils.
Is there any situation that needs ordering in the config file?

@csteinmetz1
Copy link
Collaborator Author

csteinmetz1 commented Feb 3, 2023

The issue I observed was when I loaded our demucs from the checkpoint without using the lightning module the sources in model.sources used the ordering from the config whereas when loading checkpoint via the lightning module the ordering was correct (based on the ordering in the utils).

As long as we default to ordering inside the utils it seems okay, and will set the ordering based on that when loading checkpoints.

@yoyolicoris
Copy link
Member

yoyolicoris commented Feb 3, 2023

Ah, I see where you were talking.
Notice that other models don't have the same attribute sources like HDemucs from torchaudio.
Using the targets from the config would be better than model.sources.
I will add some comments to #18 later.

@yoyolicoris
Copy link
Member

Close due to inactive.

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

No branches or pull requests

2 participants