RetroCirce / Zero_Shot_Audio_Source_Separation

The official code repo for "Zero-shot Audio Source Separation through Query-based Learning from Weakly-labeled Data", in AAAI 2022
https://arxiv.org/abs/2112.07891
MIT License
186 stars 31 forks source link

AssertionError: there should be a saved model when inferring #4

Closed playdasegunda closed 2 years ago

playdasegunda commented 2 years ago

Hi how are you?

Fllowed the guidelines for using Zero Shot ASS but I am getting the following error when trying to use inference (same error occurs on google colab and on my local computer)

I already downloaded the checkpoint templates and already made the directory changes in the config.py file, but I still get this error, how can I resolve this issue? again thank you very much!

RETURN ERROR: Screenshot_3

This is my already configured config.py file Screenshot_4

RetroCirce commented 2 years ago

Hi Sure, I'm happy to help. So first the error lies in the 205 line in the main.py _assert config.resumecheckpoint is not None, "there should be a saved model when inferring"

The model checkpoint is set in the variable "resume_checkpoint" in the config.py, instead of "wa_model_path". The "wa" variables are used for the training (to get the weight average model after the training).

And second, you need to use one card instead of four cards for the inference. I have made a change in the README.md. It is already enough to inference in a single card.

Third, you need to check the htsat_config.py and also set its "resume_checkpoint" variable to be the sound event detection ckpt, which can also be downloaded in the same google folder.

Last, you need to change the "test_key" in the config.py to be something like ["name"], a one-item str array, which indicates the source you want to separate according to the query. Notice that the test_key is only the name.