the command :
python test.py "../datasets/Nsynth/nsynth-valid/audio/" "./audiofake"
--resume_path "./model_path/2023-05-10-08-55/best_1.pth"
The error as follows:
(soundstream) root@autodl-container-1cb1119f52-820c06c3:~/autodl-tmp/paper/SoundStream_24k_240d# bash test.sh
Traceback (most recent call last):
File "test.py", line 159, in
test_batch()
File "test.py", line 151, in test_batch
soundstream.load_state_dict(new_state_dict) # load model
File "/root/miniconda3/envs/soundstream/lib/python3.8/site-packages/torch/nn/modules/module.py", line 2041, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for SoundStream:
size mismatch for encoder.model.0.conv.conv.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([48]).
size mismatch for encoder.model.0.conv.conv.weight_g: copying a param with shape torch.Size([32, 1, 1]) from checkpoint, the shape in current model is torch.Size([48, 1, 1]).
size mismatch for encoder.model.0.conv.conv.weight_v: copying a param with shape torch.Size([32, 1, 7]) from checkpoint, the shape in current model is torch.Size([48, 1, 7]).
size mismatch for encoder.model.1.block.1.conv.conv.bias: copying a param with shape torch.Size([16]) from checkpoint, the shape in current model is torch.Size([24]).
size mismatch for encoder.model.1.block.1.conv.conv.weight_g: copying a param with shape torch.Size([16, 1, 1]) from checkpoint, the shape in current model is torch.Size([24, 1, 1]).
size mismatch for encoder.model.1.block.1.conv.conv.weight_v: copying a param with shape torch.Size([16, 32, 3]) from checkpoint, the shape in current model is torch.Size([24, 48, 3]).
size mismatch for encoder.model.1.block.3.conv.conv.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([48]).
size mismatch for encoder.model.1.block.3.conv.conv.weight_g: copying a param with shape torch.Size([32, 1, 1]) from checkpoint, the shape in current model is torch.Size([48, 1, 1]).
size mismatch for encoder.model.1.block.3.conv.conv.weight_v: copying a param with shape torch.Size([32, 16, 1]) from checkpoint, the shape in current model is torch.Size([48, 24, 1]).
size mismatch for encoder.model.1.shortcut.conv.conv.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([48]).
size mismatch for encoder.model.1.shortcut.conv.conv.weight_g: copying a param with shape torch.Size([32, 1, 1]) from checkpoint, the shape in current model is torch.Size([48, 1, 1]).
size mismatch for encoder.model.1.shortcut.conv.conv.weight_v: copying a param with shape torch.Size([32, 32, 1]) from checkpoint, the shape in current model is torch.Size([48, 48, 1]).
size mismatch for encoder.model.3.conv.conv.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for encoder.model.3.conv.conv.weight_g: copying a param with shape torch.Size([64, 1, 1]) from checkpoint, the shape in current model is torch.Size([96, 1, 1]).
size mismatch for encoder.model.3.conv.conv.weight_v: copying a param with shape torch.Size([64, 32, 4]) from checkpoint, the shape in current model is torch.Size([96, 48, 4]).
size mismatch for encoder.model.4.block.1.conv.conv.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([48]).
size mismatch for encoder.model.4.block.1.conv.conv.weight_g: copying a param with shape torch.Size([32, 1, 1]) from checkpoint, the shape in current model is torch.Size([48, 1, 1]).
size mismatch for encoder.model.4.block.1.conv.conv.weight_v: copying a param with shape torch.Size([32, 64, 3]) from checkpoint, the shape in current model is torch.Size([48, 96, 3]).
size mismatch for encoder.model.4.block.3.conv.conv.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for encoder.model.4.block.3.conv.conv.weight_g: copying a param with shape torch.Size([64, 1, 1]) from checkpoint, the shape in current model is torch.Size([96, 1, 1]).
size mismatch for encoder.model.4.block.3.conv.conv.weight_v: copying a param with shape torch.Size([64, 32, 1]) from checkpoint, the shape in current model is torch.Size([96, 48, 1]).
size mismatch for encoder.model.4.shortcut.conv.conv.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for encoder.model.4.shortcut.conv.conv.weight_g: copying a param with shape torch.Size([64, 1, 1]) from checkpoint, the shape in current model is torch.Size([96, 1, 1]).
size mismatch for encoder.model.4.shortcut.conv.conv.weight_v: copying a param with shape torch.Size([64, 64, 1]) from checkpoint, the shape in current model is torch.Size([96, 96, 1]).
size mismatch for encoder.model.6.conv.conv.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([192]).
size mismatch for encoder.model.6.conv.conv.weight_g: copying a param with shape torch.Size([128, 1, 1]) from checkpoint, the shape in current model is torch.Size([192, 1, 1]).
size mismatch for encoder.model.6.conv.conv.weight_v: copying a param with shape torch.Size([128, 64, 8]) from checkpoint, the shape in current model is torch.Size([192, 96, 8]).
size mismatch for encoder.model.7.block.1.conv.conv.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for encoder.model.7.block.1.conv.conv.weight_g: copying a param with shape torch.Size([64, 1, 1]) from checkpoint, the shape in current model is torch.Size([96, 1, 1]).
size mismatch for encoder.model.7.block.1.conv.conv.weight_v: copying a param with shape torch.Size([64, 128, 3]) from checkpoint, the shape in current model is torch.Size([96, 192, 3]).
size mismatch for encoder.model.7.block.3.conv.conv.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([192]).
size mismatch for encoder.model.7.block.3.conv.conv.weight_g: copying a param with shape torch.Size([128, 1, 1]) from checkpoint, the shape in current model is torch.Size([192, 1, 1]).
size mismatch for encoder.model.7.block.3.conv.conv.weight_v: copying a param with shape torch.Size([128, 64, 1]) from checkpoint, the shape in current model is torch.Size([192, 96, 1]).
size mismatch for encoder.model.7.shortcut.conv.conv.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([192]).
size mismatch for encoder.model.7.shortcut.conv.conv.weight_g: copying a param with shape torch.Size([128, 1, 1]) from checkpoint, the shape in current model is torch.Size([192, 1, 1]).
size mismatch for encoder.model.7.shortcut.conv.conv.weight_v: copying a param with shape torch.Size([128, 128, 1]) from checkpoint, the shape in current model is torch.Size([192, 192, 1]).
size mismatch for encoder.model.9.conv.conv.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([384]).
size mismatch for encoder.model.9.conv.conv.weight_g: copying a param with shape torch.Size([256, 1, 1]) from checkpoint, the shape in current model is torch.Size([384, 1, 1]).
size mismatch for encoder.model.9.conv.conv.weight_v: copying a param with shape torch.Size([256, 128, 10]) from checkpoint, the shape in current model is torch.Size([384, 192, 10]).
size mismatch for encoder.model.10.block.1.conv.conv.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([192]).
size mismatch for encoder.model.10.block.1.conv.conv.weight_g: copying a param with shape torch.Size([128, 1, 1]) from checkpoint, the shape in current model is torch.Size([192, 1, 1]).
size mismatch for encoder.model.10.block.1.conv.conv.weight_v: copying a param with shape torch.Size([128, 256, 3]) from checkpoint, the shape in current model is torch.Size([192, 384, 3]).
size mismatch for encoder.model.10.block.3.conv.conv.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([384]).
size mismatch for encoder.model.10.block.3.conv.conv.weight_g: copying a param with shape torch.Size([256, 1, 1]) from checkpoint, the shape in current model is torch.Size([384, 1, 1]).
size mismatch for encoder.model.10.block.3.conv.conv.weight_v: copying a param with shape torch.Size([256, 128, 1]) from checkpoint, the shape in current model is torch.Size([384, 192, 1]).
size mismatch for encoder.model.10.shortcut.conv.conv.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([384]).
size mismatch for encoder.model.10.shortcut.conv.conv.weight_g: copying a param with shape torch.Size([256, 1, 1]) from checkpoint, the shape in current model is torch.Size([384, 1, 1]).
size mismatch for encoder.model.10.shortcut.conv.conv.weight_v: copying a param with shape torch.Size([256, 256, 1]) from checkpoint, the shape in current model is torch.Size([384, 384, 1]).
size mismatch for encoder.model.12.conv.conv.bias: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([768]).
size mismatch for encoder.model.12.conv.conv.weight_g: copying a param with shape torch.Size([512, 1, 1]) from checkpoint, the shape in current model is torch.Size([768, 1, 1]).
size mismatch for encoder.model.12.conv.conv.weight_v: copying a param with shape torch.Size([512, 256, 12]) from checkpoint, the shape in current model is torch.Size([768, 384, 12]).
size mismatch for encoder.model.13.lstm.weight_ih_l0: copying a param with shape torch.Size([2048, 512]) from checkpoint, the shape in current model is torch.Size([3072, 768]).
size mismatch for encoder.model.13.lstm.weight_hh_l0: copying a param with shape torch.Size([2048, 512]) from checkpoint, the shape in current model is torch.Size([3072, 768]).
size mismatch for encoder.model.13.lstm.bias_ih_l0: copying a param with shape torch.Size([2048]) from checkpoint, the shape in current model is torch.Size([3072]).
size mismatch for encoder.model.13.lstm.bias_hh_l0: copying a param with shape torch.Size([2048]) from checkpoint, the shape in current model is torch.Size([3072]).
size mismatch for encoder.model.13.lstm.weight_ih_l1: copying a param with shape torch.Size([2048, 512]) from checkpoint, the shape in current model is torch.Size([3072, 768]).
size mismatch for encoder.model.13.lstm.weight_hh_l1: copying a param with shape torch.Size([2048, 512]) from checkpoint, the shape in current model is torch.Size([3072, 768]).
size mismatch for encoder.model.13.lstm.bias_ih_l1: copying a param with shape torch.Size([2048]) from checkpoint, the shape in current model is torch.Size([3072]).
size mismatch for encoder.model.13.lstm.bias_hh_l1: copying a param with shape torch.Size([2048]) from checkpoint, the shape in current model is torch.Size([3072]).
size mismatch for encoder.model.15.conv.conv.weight_v: copying a param with shape torch.Size([512, 512, 7]) from checkpoint, the shape in current model is torch.Size([512, 768, 7]).
size mismatch for decoder.model.0.conv.conv.bias: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([768]).
size mismatch for decoder.model.0.conv.conv.weight_g: copying a param with shape torch.Size([512, 1, 1]) from checkpoint, the shape in current model is torch.Size([768, 1, 1]).
size mismatch for decoder.model.0.conv.conv.weight_v: copying a param with shape torch.Size([512, 512, 7]) from checkpoint, the shape in current model is torch.Size([768, 512, 7]).
size mismatch for decoder.model.1.lstm.weight_ih_l0: copying a param with shape torch.Size([2048, 512]) from checkpoint, the shape in current model is torch.Size([3072, 768]).
size mismatch for decoder.model.1.lstm.weight_hh_l0: copying a param with shape torch.Size([2048, 512]) from checkpoint, the shape in current model is torch.Size([3072, 768]).
size mismatch for decoder.model.1.lstm.bias_ih_l0: copying a param with shape torch.Size([2048]) from checkpoint, the shape in current model is torch.Size([3072]).
size mismatch for decoder.model.1.lstm.bias_hh_l0: copying a param with shape torch.Size([2048]) from checkpoint, the shape in current model is torch.Size([3072]).
size mismatch for decoder.model.1.lstm.weight_ih_l1: copying a param with shape torch.Size([2048, 512]) from checkpoint, the shape in current model is torch.Size([3072, 768]).
size mismatch for decoder.model.1.lstm.weight_hh_l1: copying a param with shape torch.Size([2048, 512]) from checkpoint, the shape in current model is torch.Size([3072, 768]).
size mismatch for decoder.model.1.lstm.bias_ih_l1: copying a param with shape torch.Size([2048]) from checkpoint, the shape in current model is torch.Size([3072]).
size mismatch for decoder.model.1.lstm.bias_hh_l1: copying a param with shape torch.Size([2048]) from checkpoint, the shape in current model is torch.Size([3072]).
size mismatch for decoder.model.3.convtr.convtr.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([384]).
size mismatch for decoder.model.3.convtr.convtr.weight_g: copying a param with shape torch.Size([512, 1, 1]) from checkpoint, the shape in current model is torch.Size([768, 1, 1]).
size mismatch for decoder.model.3.convtr.convtr.weight_v: copying a param with shape torch.Size([512, 256, 12]) from checkpoint, the shape in current model is torch.Size([768, 384, 12]).
size mismatch for decoder.model.4.block.1.conv.conv.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([192]).
size mismatch for decoder.model.4.block.1.conv.conv.weight_g: copying a param with shape torch.Size([128, 1, 1]) from checkpoint, the shape in current model is torch.Size([192, 1, 1]).
size mismatch for decoder.model.4.block.1.conv.conv.weight_v: copying a param with shape torch.Size([128, 256, 3]) from checkpoint, the shape in current model is torch.Size([192, 384, 3]).
size mismatch for decoder.model.4.block.3.conv.conv.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([384]).
size mismatch for decoder.model.4.block.3.conv.conv.weight_g: copying a param with shape torch.Size([256, 1, 1]) from checkpoint, the shape in current model is torch.Size([384, 1, 1]).
size mismatch for decoder.model.4.block.3.conv.conv.weight_v: copying a param with shape torch.Size([256, 128, 1]) from checkpoint, the shape in current model is torch.Size([384, 192, 1]).
size mismatch for decoder.model.4.shortcut.conv.conv.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([384]).
size mismatch for decoder.model.4.shortcut.conv.conv.weight_g: copying a param with shape torch.Size([256, 1, 1]) from checkpoint, the shape in current model is torch.Size([384, 1, 1]).
size mismatch for decoder.model.4.shortcut.conv.conv.weight_v: copying a param with shape torch.Size([256, 256, 1]) from checkpoint, the shape in current model is torch.Size([384, 384, 1]).
size mismatch for decoder.model.6.convtr.convtr.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([192]).
size mismatch for decoder.model.6.convtr.convtr.weight_g: copying a param with shape torch.Size([256, 1, 1]) from checkpoint, the shape in current model is torch.Size([384, 1, 1]).
size mismatch for decoder.model.6.convtr.convtr.weight_v: copying a param with shape torch.Size([256, 128, 10]) from checkpoint, the shape in current model is torch.Size([384, 192, 10]).
size mismatch for decoder.model.7.block.1.conv.conv.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for decoder.model.7.block.1.conv.conv.weight_g: copying a param with shape torch.Size([64, 1, 1]) from checkpoint, the shape in current model is torch.Size([96, 1, 1]).
size mismatch for decoder.model.7.block.1.conv.conv.weight_v: copying a param with shape torch.Size([64, 128, 3]) from checkpoint, the shape in current model is torch.Size([96, 192, 3]).
size mismatch for decoder.model.7.block.3.conv.conv.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([192]).
size mismatch for decoder.model.7.block.3.conv.conv.weight_g: copying a param with shape torch.Size([128, 1, 1]) from checkpoint, the shape in current model is torch.Size([192, 1, 1]).
size mismatch for decoder.model.7.block.3.conv.conv.weight_v: copying a param with shape torch.Size([128, 64, 1]) from checkpoint, the shape in current model is torch.Size([192, 96, 1]).
size mismatch for decoder.model.7.shortcut.conv.conv.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([192]).
size mismatch for decoder.model.7.shortcut.conv.conv.weight_g: copying a param with shape torch.Size([128, 1, 1]) from checkpoint, the shape in current model is torch.Size([192, 1, 1]).
size mismatch for decoder.model.7.shortcut.conv.conv.weight_v: copying a param with shape torch.Size([128, 128, 1]) from checkpoint, the shape in current model is torch.Size([192, 192, 1]).
size mismatch for decoder.model.9.convtr.convtr.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for decoder.model.9.convtr.convtr.weight_g: copying a param with shape torch.Size([128, 1, 1]) from checkpoint, the shape in current model is torch.Size([192, 1, 1]).
size mismatch for decoder.model.9.convtr.convtr.weight_v: copying a param with shape torch.Size([128, 64, 8]) from checkpoint, the shape in current model is torch.Size([192, 96, 8]).
size mismatch for decoder.model.10.block.1.conv.conv.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([48]).
size mismatch for decoder.model.10.block.1.conv.conv.weight_g: copying a param with shape torch.Size([32, 1, 1]) from checkpoint, the shape in current model is torch.Size([48, 1, 1]).
size mismatch for decoder.model.10.block.1.conv.conv.weight_v: copying a param with shape torch.Size([32, 64, 3]) from checkpoint, the shape in current model is torch.Size([48, 96, 3]).
size mismatch for decoder.model.10.block.3.conv.conv.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for decoder.model.10.block.3.conv.conv.weight_g: copying a param with shape torch.Size([64, 1, 1]) from checkpoint, the shape in current model is torch.Size([96, 1, 1]).
size mismatch for decoder.model.10.block.3.conv.conv.weight_v: copying a param with shape torch.Size([64, 32, 1]) from checkpoint, the shape in current model is torch.Size([96, 48, 1]).
size mismatch for decoder.model.10.shortcut.conv.conv.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for decoder.model.10.shortcut.conv.conv.weight_g: copying a param with shape torch.Size([64, 1, 1]) from checkpoint, the shape in current model is torch.Size([96, 1, 1]).
size mismatch for decoder.model.10.shortcut.conv.conv.weight_v: copying a param with shape torch.Size([64, 64, 1]) from checkpoint, the shape in current model is torch.Size([96, 96, 1]).
size mismatch for decoder.model.12.convtr.convtr.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([48]).
size mismatch for decoder.model.12.convtr.convtr.weight_g: copying a param with shape torch.Size([64, 1, 1]) from checkpoint, the shape in current model is torch.Size([96, 1, 1]).
size mismatch for decoder.model.12.convtr.convtr.weight_v: copying a param with shape torch.Size([64, 32, 4]) from checkpoint, the shape in current model is torch.Size([96, 48, 4]).
size mismatch for decoder.model.13.block.1.conv.conv.bias: copying a param with shape torch.Size([16]) from checkpoint, the shape in current model is torch.Size([24]).
size mismatch for decoder.model.13.block.1.conv.conv.weight_g: copying a param with shape torch.Size([16, 1, 1]) from checkpoint, the shape in current model is torch.Size([24, 1, 1]).
size mismatch for decoder.model.13.block.1.conv.conv.weight_v: copying a param with shape torch.Size([16, 32, 3]) from checkpoint, the shape in current model is torch.Size([24, 48, 3]).
size mismatch for decoder.model.13.block.3.conv.conv.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([48]).
size mismatch for decoder.model.13.block.3.conv.conv.weight_g: copying a param with shape torch.Size([32, 1, 1]) from checkpoint, the shape in current model is torch.Size([48, 1, 1]).
size mismatch for decoder.model.13.block.3.conv.conv.weight_v: copying a param with shape torch.Size([32, 16, 1]) from checkpoint, the shape in current model is torch.Size([48, 24, 1]).
size mismatch for decoder.model.13.shortcut.conv.conv.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([48]).
size mismatch for decoder.model.13.shortcut.conv.conv.weight_g: copying a param with shape torch.Size([32, 1, 1]) from checkpoint, the shape in current model is torch.Size([48, 1, 1]).
size mismatch for decoder.model.13.shortcut.conv.conv.weight_v: copying a param with shape torch.Size([32, 32, 1]) from checkpoint, the shape in current model is torch.Size([48, 48, 1]).
size mismatch for decoder.model.15.conv.conv.weight_v: copying a param with shape torch.Size([1, 32, 7]) from checkpoint, the shape in current model is torch.Size([1, 48, 7]).