-
I have managed to train my model on a dataset with three sources. I was wondering, is it possible to evaluate how this will perform on two sources? As I trained it differently from run.sh, I had to use a modified eval.py as well. Here are my train.py and eval.py: train.py #train_loader, val_loader = DPRNNTasNet.loaders_from_mini(task="sep_clean", batch_size=16) loss = PITLossWrapper(pairwise_neg_sisdr, pit_from="pw_mtx") optimizer = optim.Adam(model.parameters(), lr=1e-3) system = System(model, optimizer, loss, train_loader, val_loader) trainer = Trainer(max_epochs=200, gpus=1) trainer.fit(system) model.separate("trclean1.wav", force_overwrite=True,resample=True) torch.save(model, "model1.pth") torch.save(model.state_dict(), "state_dict.pth") eval.py from asteroid.metrics import get_metrics parser = argparse.ArgumentParser() COMPUTE_METRICS = ["si_sdr", "sdr", "sir", "sar", "stoi"] def update_compute_metrics(compute_wer, metric_list):
def main(conf):
if name == "main":
When I have the n_src match up, they train and evaluate just fine, but when I try to evaluate on two sources with a model trained for three sources, I get the following error: The above exception was the direct cause of the following exception: Traceback (most recent call last): I kind of understand that the model expects a third source, but is it impossible to evaluate how it would perform when tested on mixtures with two sources? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I think you should try to read stack trace, debug your code, etc.. Try to understand the processing flow, which object expects which other object etc.. and why it fails. You'll progress much faster than asking the answer as soon as the problem emerges. Plus, the error is raised in your custom code, not in Asteroid's. |
Beta Was this translation helpful? Give feedback.
I think you should try to read stack trace, debug your code, etc.. Try to understand the processing flow, which object expects which other object etc.. and why it fails. You'll progress much faster than asking the answer as soon as the problem emerges.
Plus, the error is raised in your custom code, not in Asteroid's.