FaSNet-TAC-PyTorch icon indicating copy to clipboard operation
FaSNet-TAC-PyTorch copied to clipboard

assert source.size() == estimate_source.size() AssertionError

Open XianruiWang opened this issue 4 years ago • 1 comments

When I try to run this repo, it asserted an error that the dimension of estimate_sources and that of source signal are not equal. I also print the dimension, the estimated is [1,2,64000] while the other is [3,2,64000], the information is below

/home/xwang/FasNet/data.py:108: FutureWarning: Pass sr=16000 as keyword args. From version 0.10 passing these as positional argument result in an error mix, _ = librosa.load(mix_path, sr) /home/xwang/FasNet/data.py:116: FutureWarning: Pass sr=16000 as keyword args. From version 0.10 passing these as positional argument result in an error s1, _ = librosa.load(s1_path, sr) /home/xwang/FasNet/data.py:117: FutureWarning: Pass sr=16000 as keyword args. From version 0.10 passing these as positional argument result in an error s2, _ = librosa.load(s2_path, sr) torch.Size([1, 2, 64000]) torch.Size([3, 2, 64000]) torch.Size([1, 2, 64000]) Traceback (most recent call last): File "train.py", line 119, in main(args) File "train.py", line 113, in main solver.train() File "/home/xwang/FasNet/solver.py", line 77, in train tr_avg_loss = self._run_one_epoch(epoch) File "/home/xwang/FasNet/solver.py", line 164, in _run_one_epoch cal_loss(padded_source, estimate_source, mixture_lengths) File "/home/xwang/FasNet/pit_criterion.py", line 25, in cal_loss max_snr, perms, max_snr_idx = cal_si_snr_with_pit(source, File "/home/xwang/FasNet/pit_criterion.py", line 42, in cal_si_snr_with_pit assert source.size() == estimate_source.size() AssertionError

XianruiWang avatar Mar 01 '22 14:03 XianruiWang

change
none_mic = torch.zeros(1).type(x.type()) in solver.py to: none_mic = torch.from_numpy(np.array([2, 3, 4, 5, 6])).view(-1,).type(x.type()) similar to the code in FaSNet.py I think it'll be fine

wxystudio avatar Mar 08 '22 06:03 wxystudio