Open adagio715 opened 1 year ago
@adagio715 you can unsqueeze the wav like _wav = convert_audio(wav, sr, model.samplerate, model.channels) wav = wav.unsqueeze(0) follows the encodec repo https://github.com/facebookresearch/encodec
@startreker-shzy Thanks, it worked for the encodec model.
But for the mbd model the following error occured when executing compressed_diffusion = mbd.regenerate(wav, sample_rate=sr)
: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same or input should be a MKLDNN tensor and weight is a dense tensor
.
To solve this error, do device = torch.device("cuda" if torch.cuda.is_available() else "cpu"); wav = wav.to(device)
before running compressed_diffusion = mbd.regenerate(wav, sample_rate=sr)
can work.
@adagio715 Thanks for your sharing. And I can get the regenerated output. But the sounds has white noise. #236
@startreker-shzy Same here, and I tried the scaling method given under #236. It works. However, the mbd outputs have energy until ~6khz, while the signal is very weak above 6khz. Did you also experience this issue? #236
Thank you very much for open-sourcing the great work. I wanted to compare Encodec and MBD on the compression task by using the source codes on this page . Specifically, on colab ipynb, I installed audiocraft==1.0.0 by installing from github repo, and then I ran this code snippet:
However, when executing![image](https://github.com/facebookresearch/audiocraft/assets/109852611/431890ac-6021-4fa3-9fc5-d1a473121065)
compressed_encodec = encodec(wav)
andcompressed_diffusion = mbd.regenerate(wav, sample_rate=sr)
, errors occured and both seemed to relate to the dimension of the parsed music data. Here is the error forcompressed_encodec = encodec(wav)
:Here is the error for![image](https://github.com/facebookresearch/audiocraft/assets/109852611/bd15961f-67c9-48fd-a214-f91358a58e93)
compressed_diffusion = mbd.regenerate(wav, sample_rate=sr)
:Can someone help with this issue? Thanks.