Hack so that multichannel doesn't crash with librosa

This commit is contained in:
akhlif
2020-03-27 16:15:14 +01:00
parent 38bfff833e
commit f8c728a67b

View File

@@ -145,8 +145,10 @@ class Separator(object):
# TODO: fix the logic, build sometimes return, sometimes set attribute
outputs = builder.outputs
stft = self.stft(waveform)
if stft.shape[-1] != 2:
if stft.shape[-1] == 1:
stft = np.concatenate([stft, stft], axis=-1)
elif stft.shape[-1] > 2:
stft = stft[:, :2]
saver = tf.train.Saver()
with tf.Session() as sess: