code: import torch
  ori = torch.load('/Users/ibobby/Dataset/model_weights/BasicVSR/v-bi.pth')
  ori = ori['state_dict']
  new = {}
  for k in ori.keys():
      new[k.replace('generator.', '')] = ori[k]
  # Rename
  m = list()
  u = list()
  # PixelShufflePack
  m += ["upsample1.main.0.weight", "upsample1.main.0.bias", "upsample2.main.0.weight", "upsample2.main.0.bias"]
  u += ["upsample1.upsample_conv.weight", "upsample1.upsample_conv.bias", "upsample2.upsample_conv.weight", "upsample2.upsample_conv.bias"]
  # ResidualBlock
  m += ["backward_resblocks.main.2.conv.0.weight", "backward_resblocks.main.2.conv.0.bias", "backward_resblocks.main.2.conv.2.weight", "backward_resblocks.main.2.conv.2.bias", "backward_resblocks.main.3.conv.0.weight", "backward_resblocks.main.3.conv.0.bias", "backward_resblocks.main.3.conv.2.weight", "backward_resblocks.main.3.conv.2.bias", "backward_resblocks.main.4.conv.0.weight", "backward_resblocks.main.4.conv.0.bias", "backward_resblocks.main.4.conv.2.weight", "backward_resblocks.main.4.conv.2.bias", "backward_resblocks.main.5.conv.0.weight", "backward_resblocks.main.5.conv.0.bias", "backward_resblocks.main.5.conv.2.weight", "backward_resblocks.main.5.conv.2.bias", "backward_resblocks.main.6.conv.0.weight", "backward_resblocks.main.6.conv.0.bias", "backward_resblocks.main.6.conv.2.weight", "backward_resblocks.main.6.conv.2.bias", "backward_resblocks.main.7.conv.0.weight", "backward_resblocks.main.7.conv.0.bias", "backward_resblocks.main.7.conv.2.weight", "backward_resblocks.main.7.conv.2.bias", "backward_resblocks.main.8.conv.0.weight", "backward_resblocks.main.8.conv.0.bias", "backward_resblocks.main.8.conv.2.weight", "backward_resblocks.main.8.conv.2.bias", "backward_resblocks.main.9.conv.0.weight", "backward_resblocks.main.9.conv.0.bias", "backward_resblocks.main.9.conv.2.weight", "backward_resblocks.main.9.conv.2.bias", "backward_resblocks.main.10.conv.0.weight", "backward_resblocks.main.10.conv.0.bias", "backward_resblocks.main.10.conv.2.weight", "backward_resblocks.main.10.conv.2.bias", "backward_resblocks.main.11.conv.0.weight", "backward_resblocks.main.11.conv.0.bias", "backward_resblocks.main.11.conv.2.weight", "backward_resblocks.main.11.conv.2.bias", "backward_resblocks.main.12.conv.0.weight", "backward_resblocks.main.12.conv.0.bias", "backward_resblocks.main.12.conv.2.weight", "backward_resblocks.main.12.conv.2.bias", "backward_resblocks.main.13.conv.0.weight", "backward_resblocks.main.13.conv.0.bias", "backward_resblocks.main.13.conv.2.weight", "backward_resblocks.main.13.conv.2.bias", "backward_resblocks.main.14.conv.0.weight", "backward_resblocks.main.14.conv.0.bias", "backward_resblocks.main.14.conv.2.weight", "backward_resblocks.main.14.conv.2.bias", "backward_resblocks.main.15.conv.0.weight", "backward_resblocks.main.15.conv.0.bias", "backward_resblocks.main.15.conv.2.weight", "backward_resblocks.main.15.conv.2.bias", "backward_resblocks.main.16.conv.0.weight", "backward_resblocks.main.16.conv.0.bias", "backward_resblocks.main.16.conv.2.weight", "backward_resblocks.main.16.conv.2.bias", "backward_resblocks.main.17.conv.0.weight", "backward_resblocks.main.17.conv.0.bias", "backward_resblocks.main.17.conv.2.weight", "backward_resblocks.main.17.conv.2.bias", "backward_resblocks.main.18.conv.0.weight", "backward_resblocks.main.18.conv.0.bias", "backward_resblocks.main.18.conv.2.weight", "backward_resblocks.main.18.conv.2.bias", "backward_resblocks.main.19.conv.0.weight", "backward_resblocks.main.19.conv.0.bias", "backward_resblocks.main.19.conv.2.weight", "backward_resblocks.main.19.conv.2.bias", "backward_resblocks.main.20.conv.0.weight", "backward_resblocks.main.20.conv.0.bias", "backward_resblocks.main.20.conv.2.weight", "backward_resblocks.main.20.conv.2.bias", "backward_resblocks.main.21.conv.0.weight", "backward_resblocks.main.21.conv.0.bias", "backward_resblocks.main.21.conv.2.weight", "backward_resblocks.main.21.conv.2.bias", "backward_resblocks.main.22.conv.0.weight", "backward_resblocks.main.22.conv.0.bias", "backward_resblocks.main.22.conv.2.weight", "backward_resblocks.main.22.conv.2.bias", "backward_resblocks.main.23.conv.0.weight", "backward_resblocks.main.23.conv.0.bias", "backward_resblocks.main.23.conv.2.weight", "backward_resblocks.main.23.conv.2.bias", "backward_resblocks.main.24.conv.0.weight", "backward_resblocks.main.24.conv.0.bias", "backward_resblocks.main.24.conv.2.weight", "backward_resblocks.main.24.conv.2.bias", "backward_resblocks.main.25.conv.0.weight", "backward_resblocks.main.25.conv.0.bias", "backward_resblocks.main.25.conv.2.weight", "backward_resblocks.main.25.conv.2.bias", "backward_resblocks.main.26.conv.0.weight", "backward_resblocks.main.26.conv.0.bias", "backward_resblocks.main.26.conv.2.weight", "backward_resblocks.main.26.conv.2.bias", "backward_resblocks.main.27.conv.0.weight", "backward_resblocks.main.27.conv.0.bias", "backward_resblocks.main.27.conv.2.weight", "backward_resblocks.main.27.conv.2.bias", "backward_resblocks.main.28.conv.0.weight", "backward_resblocks.main.28.conv.0.bias", "backward_resblocks.main.28.conv.2.weight", "backward_resblocks.main.28.conv.2.bias", "backward_resblocks.main.29.conv.0.weight", "backward_resblocks.main.29.conv.0.bias", "backward_resblocks.main.29.conv.2.weight", "backward_resblocks.main.29.conv.2.bias", "backward_resblocks.main.30.conv.0.weight", "backward_resblocks.main.30.conv.0.bias", "backward_resblocks.main.30.conv.2.weight", "backward_resblocks.main.30.conv.2.bias", "backward_resblocks.main.31.conv.0.weight", "backward_resblocks.main.31.conv.0.bias", "backward_resblocks.main.31.conv.2.weight", "backward_resblocks.main.31.conv.2.bias", "forward_resblocks.main.2.conv.0.weight", "forward_resblocks.main.2.conv.0.bias", "forward_resblocks.main.2.conv.2.weight", "forward_resblocks.main.2.conv.2.bias", "forward_resblocks.main.3.conv.0.weight", "forward_resblocks.main.3.conv.0.bias", "forward_resblocks.main.3.conv.2.weight", "forward_resblocks.main.3.conv.2.bias", "forward_resblocks.main.4.conv.0.weight", "forward_resblocks.main.4.conv.0.bias", "forward_resblocks.main.4.conv.2.weight", "forward_resblocks.main.4.conv.2.bias", "forward_resblocks.main.5.conv.0.weight", "forward_resblocks.main.5.conv.0.bias", "forward_resblocks.main.5.conv.2.weight", "forward_resblocks.main.5.conv.2.bias", "forward_resblocks.main.6.conv.0.weight", "forward_resblocks.main.6.conv.0.bias", "forward_resblocks.main.6.conv.2.weight", "forward_resblocks.main.6.conv.2.bias", "forward_resblocks.main.7.conv.0.weight", "forward_resblocks.main.7.conv.0.bias", "forward_resblocks.main.7.conv.2.weight", "forward_resblocks.main.7.conv.2.bias", "forward_resblocks.main.8.conv.0.weight", "forward_resblocks.main.8.conv.0.bias", "forward_resblocks.main.8.conv.2.weight", "forward_resblocks.main.8.conv.2.bias", "forward_resblocks.main.9.conv.0.weight", "forward_resblocks.main.9.conv.0.bias", "forward_resblocks.main.9.conv.2.weight", "forward_resblocks.main.9.conv.2.bias", "forward_resblocks.main.10.conv.0.weight", "forward_resblocks.main.10.conv.0.bias", "forward_resblocks.main.10.conv.2.weight", "forward_resblocks.main.10.conv.2.bias", "forward_resblocks.main.11.conv.0.weight", "forward_resblocks.main.11.conv.0.bias", "forward_resblocks.main.11.conv.2.weight", "forward_resblocks.main.11.conv.2.bias", "forward_resblocks.main.12.conv.0.weight", "forward_resblocks.main.12.conv.0.bias", "forward_resblocks.main.12.conv.2.weight", "forward_resblocks.main.12.conv.2.bias", "forward_resblocks.main.13.conv.0.weight", "forward_resblocks.main.13.conv.0.bias", "forward_resblocks.main.13.conv.2.weight", "forward_resblocks.main.13.conv.2.bias", "forward_resblocks.main.14.conv.0.weight", "forward_resblocks.main.14.conv.0.bias", "forward_resblocks.main.14.conv.2.weight", "forward_resblocks.main.14.conv.2.bias", "forward_resblocks.main.15.conv.0.weight", "forward_resblocks.main.15.conv.0.bias", "forward_resblocks.main.15.conv.2.weight", "forward_resblocks.main.15.conv.2.bias", "forward_resblocks.main.16.conv.0.weight", "forward_resblocks.main.16.conv.0.bias", "forward_resblocks.main.16.conv.2.weight", "forward_resblocks.main.16.conv.2.bias", "forward_resblocks.main.17.conv.0.weight", "forward_resblocks.main.17.conv.0.bias", "forward_resblocks.main.17.conv.2.weight", "forward_resblocks.main.17.conv.2.bias", "forward_resblocks.main.18.conv.0.weight", "forward_resblocks.main.18.conv.0.bias", "forward_resblocks.main.18.conv.2.weight", "forward_resblocks.main.18.conv.2.bias", "forward_resblocks.main.19.conv.0.weight", "forward_resblocks.main.19.conv.0.bias", "forward_resblocks.main.19.conv.2.weight", "forward_resblocks.main.19.conv.2.bias", "forward_resblocks.main.20.conv.0.weight", "forward_resblocks.main.20.conv.0.bias", "forward_resblocks.main.20.conv.2.weight", "forward_resblocks.main.20.conv.2.bias", "forward_resblocks.main.21.conv.0.weight", "forward_resblocks.main.21.conv.0.bias", "forward_resblocks.main.21.conv.2.weight", "forward_resblocks.main.21.conv.2.bias", "forward_resblocks.main.22.conv.0.weight", "forward_resblocks.main.22.conv.0.bias", "forward_resblocks.main.22.conv.2.weight", "forward_resblocks.main.22.conv.2.bias", "forward_resblocks.main.23.conv.0.weight", "forward_resblocks.main.23.conv.0.bias", "forward_resblocks.main.23.conv.2.weight", "forward_resblocks.main.23.conv.2.bias", "forward_resblocks.main.24.conv.0.weight", "forward_resblocks.main.24.conv.0.bias", "forward_resblocks.main.24.conv.2.weight", "forward_resblocks.main.24.conv.2.bias", "forward_resblocks.main.25.conv.0.weight", "forward_resblocks.main.25.conv.0.bias", "forward_resblocks.main.25.conv.2.weight", "forward_resblocks.main.25.conv.2.bias", "forward_resblocks.main.26.conv.0.weight", "forward_resblocks.main.26.conv.0.bias", "forward_resblocks.main.26.conv.2.weight", "forward_resblocks.main.26.conv.2.bias", "forward_resblocks.main.27.conv.0.weight", "forward_resblocks.main.27.conv.0.bias", "forward_resblocks.main.27.conv.2.weight", "forward_resblocks.main.27.conv.2.bias", "forward_resblocks.main.28.conv.0.weight", "forward_resblocks.main.28.conv.0.bias", "forward_resblocks.main.28.conv.2.weight", "forward_resblocks.main.28.conv.2.bias", "forward_resblocks.main.29.conv.0.weight", "forward_resblocks.main.29.conv.0.bias", "forward_resblocks.main.29.conv.2.weight", "forward_resblocks.main.29.conv.2.bias", "forward_resblocks.main.30.conv.0.weight", "forward_resblocks.main.30.conv.0.bias", "forward_resblocks.main.30.conv.2.weight", "forward_resblocks.main.30.conv.2.bias", "forward_resblocks.main.31.conv.0.weight", "forward_resblocks.main.31.conv.0.bias", "forward_resblocks.main.31.conv.2.weight", "forward_resblocks.main.31.conv.2.bias"]
  u += ["backward_resblocks.main.2.0.conv1.weight", "backward_resblocks.main.2.0.conv1.bias", "backward_resblocks.main.2.0.conv2.weight", "backward_resblocks.main.2.0.conv2.bias", "backward_resblocks.main.2.1.conv1.weight", "backward_resblocks.main.2.1.conv1.bias", "backward_resblocks.main.2.1.conv2.weight", "backward_resblocks.main.2.1.conv2.bias", "backward_resblocks.main.2.2.conv1.weight", "backward_resblocks.main.2.2.conv1.bias", "backward_resblocks.main.2.2.conv2.weight", "backward_resblocks.main.2.2.conv2.bias", "backward_resblocks.main.2.3.conv1.weight", "backward_resblocks.main.2.3.conv1.bias", "backward_resblocks.main.2.3.conv2.weight", "backward_resblocks.main.2.3.conv2.bias", "backward_resblocks.main.2.4.conv1.weight", "backward_resblocks.main.2.4.conv1.bias", "backward_resblocks.main.2.4.conv2.weight", "backward_resblocks.main.2.4.conv2.bias", "backward_resblocks.main.2.5.conv1.weight", "backward_resblocks.main.2.5.conv1.bias", "backward_resblocks.main.2.5.conv2.weight", "backward_resblocks.main.2.5.conv2.bias", "backward_resblocks.main.2.6.conv1.weight", "backward_resblocks.main.2.6.conv1.bias", "backward_resblocks.main.2.6.conv2.weight", "backward_resblocks.main.2.6.conv2.bias", "backward_resblocks.main.2.7.conv1.weight", "backward_resblocks.main.2.7.conv1.bias", "backward_resblocks.main.2.7.conv2.weight", "backward_resblocks.main.2.7.conv2.bias", "backward_resblocks.main.2.8.conv1.weight", "backward_resblocks.main.2.8.conv1.bias", "backward_resblocks.main.2.8.conv2.weight", "backward_resblocks.main.2.8.conv2.bias", "backward_resblocks.main.2.9.conv1.weight", "backward_resblocks.main.2.9.conv1.bias", "backward_resblocks.main.2.9.conv2.weight", "backward_resblocks.main.2.9.conv2.bias", "backward_resblocks.main.2.10.conv1.weight", "backward_resblocks.main.2.10.conv1.bias", "backward_resblocks.main.2.10.conv2.weight", "backward_resblocks.main.2.10.conv2.bias", "backward_resblocks.main.2.11.conv1.weight", "backward_resblocks.main.2.11.conv1.bias", "backward_resblocks.main.2.11.conv2.weight", "backward_resblocks.main.2.11.conv2.bias", "backward_resblocks.main.2.12.conv1.weight", "backward_resblocks.main.2.12.conv1.bias", "backward_resblocks.main.2.12.conv2.weight", "backward_resblocks.main.2.12.conv2.bias", "backward_resblocks.main.2.13.conv1.weight", "backward_resblocks.main.2.13.conv1.bias", "backward_resblocks.main.2.13.conv2.weight", "backward_resblocks.main.2.13.conv2.bias", "backward_resblocks.main.2.14.conv1.weight", "backward_resblocks.main.2.14.conv1.bias", "backward_resblocks.main.2.14.conv2.weight", "backward_resblocks.main.2.14.conv2.bias", "backward_resblocks.main.2.15.conv1.weight", "backward_resblocks.main.2.15.conv1.bias", "backward_resblocks.main.2.15.conv2.weight", "backward_resblocks.main.2.15.conv2.bias", "backward_resblocks.main.2.16.conv1.weight", "backward_resblocks.main.2.16.conv1.bias", "backward_resblocks.main.2.16.conv2.weight", "backward_resblocks.main.2.16.conv2.bias", "backward_resblocks.main.2.17.conv1.weight", "backward_resblocks.main.2.17.conv1.bias", "backward_resblocks.main.2.17.conv2.weight", "backward_resblocks.main.2.17.conv2.bias", "backward_resblocks.main.2.18.conv1.weight", "backward_resblocks.main.2.18.conv1.bias", "backward_resblocks.main.2.18.conv2.weight", "backward_resblocks.main.2.18.conv2.bias", "backward_resblocks.main.2.19.conv1.weight", "backward_resblocks.main.2.19.conv1.bias", "backward_resblocks.main.2.19.conv2.weight", "backward_resblocks.main.2.19.conv2.bias", "backward_resblocks.main.2.20.conv1.weight", "backward_resblocks.main.2.20.conv1.bias", "backward_resblocks.main.2.20.conv2.weight", "backward_resblocks.main.2.20.conv2.bias", "backward_resblocks.main.2.21.conv1.weight", "backward_resblocks.main.2.21.conv1.bias", "backward_resblocks.main.2.21.conv2.weight", "backward_resblocks.main.2.21.conv2.bias", "backward_resblocks.main.2.22.conv1.weight", "backward_resblocks.main.2.22.conv1.bias", "backward_resblocks.main.2.22.conv2.weight", "backward_resblocks.main.2.22.conv2.bias", "backward_resblocks.main.2.23.conv1.weight", "backward_resblocks.main.2.23.conv1.bias", "backward_resblocks.main.2.23.conv2.weight", "backward_resblocks.main.2.23.conv2.bias", "backward_resblocks.main.2.24.conv1.weight", "backward_resblocks.main.2.24.conv1.bias", "backward_resblocks.main.2.24.conv2.weight", "backward_resblocks.main.2.24.conv2.bias", "backward_resblocks.main.2.25.conv1.weight", "backward_resblocks.main.2.25.conv1.bias", "backward_resblocks.main.2.25.conv2.weight", "backward_resblocks.main.2.25.conv2.bias", "backward_resblocks.main.2.26.conv1.weight", "backward_resblocks.main.2.26.conv1.bias", "backward_resblocks.main.2.26.conv2.weight", "backward_resblocks.main.2.26.conv2.bias", "backward_resblocks.main.2.27.conv1.weight", "backward_resblocks.main.2.27.conv1.bias", "backward_resblocks.main.2.27.conv2.weight", "backward_resblocks.main.2.27.conv2.bias", "backward_resblocks.main.2.28.conv1.weight", "backward_resblocks.main.2.28.conv1.bias", "backward_resblocks.main.2.28.conv2.weight", "backward_resblocks.main.2.28.conv2.bias", "backward_resblocks.main.2.29.conv1.weight", "backward_resblocks.main.2.29.conv1.bias", "backward_resblocks.main.2.29.conv2.weight", "backward_resblocks.main.2.29.conv2.bias", "forward_resblocks.main.2.0.conv1.weight", "forward_resblocks.main.2.0.conv1.bias", "forward_resblocks.main.2.0.conv2.weight", "forward_resblocks.main.2.0.conv2.bias", "forward_resblocks.main.2.1.conv1.weight", "forward_resblocks.main.2.1.conv1.bias", "forward_resblocks.main.2.1.conv2.weight", "forward_resblocks.main.2.1.conv2.bias", "forward_resblocks.main.2.2.conv1.weight", "forward_resblocks.main.2.2.conv1.bias", "forward_resblocks.main.2.2.conv2.weight", "forward_resblocks.main.2.2.conv2.bias", "forward_resblocks.main.2.3.conv1.weight", "forward_resblocks.main.2.3.conv1.bias", "forward_resblocks.main.2.3.conv2.weight", "forward_resblocks.main.2.3.conv2.bias", "forward_resblocks.main.2.4.conv1.weight", "forward_resblocks.main.2.4.conv1.bias", "forward_resblocks.main.2.4.conv2.weight", "forward_resblocks.main.2.4.conv2.bias", "forward_resblocks.main.2.5.conv1.weight", "forward_resblocks.main.2.5.conv1.bias", "forward_resblocks.main.2.5.conv2.weight", "forward_resblocks.main.2.5.conv2.bias", "forward_resblocks.main.2.6.conv1.weight", "forward_resblocks.main.2.6.conv1.bias", "forward_resblocks.main.2.6.conv2.weight", "forward_resblocks.main.2.6.conv2.bias", "forward_resblocks.main.2.7.conv1.weight", "forward_resblocks.main.2.7.conv1.bias", "forward_resblocks.main.2.7.conv2.weight", "forward_resblocks.main.2.7.conv2.bias", "forward_resblocks.main.2.8.conv1.weight", "forward_resblocks.main.2.8.conv1.bias", "forward_resblocks.main.2.8.conv2.weight", "forward_resblocks.main.2.8.conv2.bias", "forward_resblocks.main.2.9.conv1.weight", "forward_resblocks.main.2.9.conv1.bias", "forward_resblocks.main.2.9.conv2.weight", "forward_resblocks.main.2.9.conv2.bias", "forward_resblocks.main.2.10.conv1.weight", "forward_resblocks.main.2.10.conv1.bias", "forward_resblocks.main.2.10.conv2.weight", "forward_resblocks.main.2.10.conv2.bias", "forward_resblocks.main.2.11.conv1.weight", "forward_resblocks.main.2.11.conv1.bias", "forward_resblocks.main.2.11.conv2.weight", "forward_resblocks.main.2.11.conv2.bias", "forward_resblocks.main.2.12.conv1.weight", "forward_resblocks.main.2.12.conv1.bias", "forward_resblocks.main.2.12.conv2.weight", "forward_resblocks.main.2.12.conv2.bias", "forward_resblocks.main.2.13.conv1.weight", "forward_resblocks.main.2.13.conv1.bias", "forward_resblocks.main.2.13.conv2.weight", "forward_resblocks.main.2.13.conv2.bias", "forward_resblocks.main.2.14.conv1.weight", "forward_resblocks.main.2.14.conv1.bias", "forward_resblocks.main.2.14.conv2.weight", "forward_resblocks.main.2.14.conv2.bias", "forward_resblocks.main.2.15.conv1.weight", "forward_resblocks.main.2.15.conv1.bias", "forward_resblocks.main.2.15.conv2.weight", "forward_resblocks.main.2.15.conv2.bias", "forward_resblocks.main.2.16.conv1.weight", "forward_resblocks.main.2.16.conv1.bias", "forward_resblocks.main.2.16.conv2.weight", "forward_resblocks.main.2.16.conv2.bias", "forward_resblocks.main.2.17.conv1.weight", "forward_resblocks.main.2.17.conv1.bias", "forward_resblocks.main.2.17.conv2.weight", "forward_resblocks.main.2.17.conv2.bias", "forward_resblocks.main.2.18.conv1.weight", "forward_resblocks.main.2.18.conv1.bias", "forward_resblocks.main.2.18.conv2.weight", "forward_resblocks.main.2.18.conv2.bias", "forward_resblocks.main.2.19.conv1.weight", "forward_resblocks.main.2.19.conv1.bias", "forward_resblocks.main.2.19.conv2.weight", "forward_resblocks.main.2.19.conv2.bias", "forward_resblocks.main.2.20.conv1.weight", "forward_resblocks.main.2.20.conv1.bias", "forward_resblocks.main.2.20.conv2.weight", "forward_resblocks.main.2.20.conv2.bias", "forward_resblocks.main.2.21.conv1.weight", "forward_resblocks.main.2.21.conv1.bias", "forward_resblocks.main.2.21.conv2.weight", "forward_resblocks.main.2.21.conv2.bias", "forward_resblocks.main.2.22.conv1.weight", "forward_resblocks.main.2.22.conv1.bias", "forward_resblocks.main.2.22.conv2.weight", "forward_resblocks.main.2.22.conv2.bias", "forward_resblocks.main.2.23.conv1.weight", "forward_resblocks.main.2.23.conv1.bias", "forward_resblocks.main.2.23.conv2.weight", "forward_resblocks.main.2.23.conv2.bias", "forward_resblocks.main.2.24.conv1.weight", "forward_resblocks.main.2.24.conv1.bias", "forward_resblocks.main.2.24.conv2.weight", "forward_resblocks.main.2.24.conv2.bias", "forward_resblocks.main.2.25.conv1.weight", "forward_resblocks.main.2.25.conv1.bias", "forward_resblocks.main.2.25.conv2.weight", "forward_resblocks.main.2.25.conv2.bias", "forward_resblocks.main.2.26.conv1.weight", "forward_resblocks.main.2.26.conv1.bias", "forward_resblocks.main.2.26.conv2.weight", "forward_resblocks.main.2.26.conv2.bias", "forward_resblocks.main.2.27.conv1.weight", "forward_resblocks.main.2.27.conv1.bias", "forward_resblocks.main.2.27.conv2.weight", "forward_resblocks.main.2.27.conv2.bias", "forward_resblocks.main.2.28.conv1.weight", "forward_resblocks.main.2.28.conv1.bias", "forward_resblocks.main.2.28.conv2.weight", "forward_resblocks.main.2.28.conv2.bias", "forward_resblocks.main.2.29.conv1.weight", "forward_resblocks.main.2.29.conv1.bias", "forward_resblocks.main.2.29.conv2.weight", "forward_resblocks.main.2.29.conv2.bias"]
  # BasicVSRNet
  m += ["upsample.0.weight", "upsample.0.bias", "upsample.2.main.0.weight", "upsample.2.main.0.bias", "upsample.4.main.0.weight", "upsample.4.main.0.bias", "upsample.6.weight", "upsample.6.bias", "upsample.8.weight", "upsample.8.bias"]
  u += ["fusion.weight", "fusion.bias", "upsample1.main.0.weight", "upsample1.main.0.bias", "upsample2.main.0.weight", "upsample2.main.0.bias", "conv_hr.weight", "conv_hr.bias", "conv_last.weight", "conv_last.bias"]
  
  for mk, uk in zip(m, u):
      new[mk] = new.pop(uk)
  
  
  # Remove
  u = list()
  # SPyNet
  u += ["spynet.mean", "spynet.std", "spynet.basic_module.0.basic_module.0.conv.weight", "spynet.basic_module.0.basic_module.0.conv.bias", "spynet.basic_module.0.basic_module.1.conv.weight", "spynet.basic_module.0.basic_module.1.conv.bias", "spynet.basic_module.0.basic_module.2.conv.weight", "spynet.basic_module.0.basic_module.2.conv.bias", "spynet.basic_module.0.basic_module.3.conv.weight", "spynet.basic_module.0.basic_module.3.conv.bias", "spynet.basic_module.0.basic_module.4.conv.weight", "spynet.basic_module.0.basic_module.4.conv.bias", "spynet.basic_module.1.basic_module.0.conv.weight", "spynet.basic_module.1.basic_module.0.conv.bias", "spynet.basic_module.1.basic_module.1.conv.weight", "spynet.basic_module.1.basic_module.1.conv.bias", "spynet.basic_module.1.basic_module.2.conv.weight", "spynet.basic_module.1.basic_module.2.conv.bias", "spynet.basic_module.1.basic_module.3.conv.weight", "spynet.basic_module.1.basic_module.3.conv.bias", "spynet.basic_module.1.basic_module.4.conv.weight", "spynet.basic_module.1.basic_module.4.conv.bias", "spynet.basic_module.2.basic_module.0.conv.weight", "spynet.basic_module.2.basic_module.0.conv.bias", "spynet.basic_module.2.basic_module.1.conv.weight", "spynet.basic_module.2.basic_module.1.conv.bias", "spynet.basic_module.2.basic_module.2.conv.weight", "spynet.basic_module.2.basic_module.2.conv.bias", "spynet.basic_module.2.basic_module.3.conv.weight", "spynet.basic_module.2.basic_module.3.conv.bias", "spynet.basic_module.2.basic_module.4.conv.weight", "spynet.basic_module.2.basic_module.4.conv.bias", "spynet.basic_module.3.basic_module.0.conv.weight", "spynet.basic_module.3.basic_module.0.conv.bias", "spynet.basic_module.3.basic_module.1.conv.weight", "spynet.basic_module.3.basic_module.1.conv.bias", "spynet.basic_module.3.basic_module.2.conv.weight", "spynet.basic_module.3.basic_module.2.conv.bias", "spynet.basic_module.3.basic_module.3.conv.weight", "spynet.basic_module.3.basic_module.3.conv.bias", "spynet.basic_module.3.basic_module.4.conv.weight", "spynet.basic_module.3.basic_module.4.conv.bias", "spynet.basic_module.4.basic_module.0.conv.weight", "spynet.basic_module.4.basic_module.0.conv.bias", "spynet.basic_module.4.basic_module.1.conv.weight", "spynet.basic_module.4.basic_module.1.conv.bias", "spynet.basic_module.4.basic_module.2.conv.weight", "spynet.basic_module.4.basic_module.2.conv.bias", "spynet.basic_module.4.basic_module.3.conv.weight", "spynet.basic_module.4.basic_module.3.conv.bias", "spynet.basic_module.4.basic_module.4.conv.weight", "spynet.basic_module.4.basic_module.4.conv.bias", "spynet.basic_module.5.basic_module.0.conv.weight", "spynet.basic_module.5.basic_module.0.conv.bias", "spynet.basic_module.5.basic_module.1.conv.weight", "spynet.basic_module.5.basic_module.1.conv.bias", "spynet.basic_module.5.basic_module.2.conv.weight", "spynet.basic_module.5.basic_module.2.conv.bias", "spynet.basic_module.5.basic_module.3.conv.weight", "spynet.basic_module.5.basic_module.3.conv.bias", "spynet.basic_module.5.basic_module.4.conv.weight", "spynet.basic_module.5.basic_module.4.conv.bias"]
  
  for u_ in u:
      new.pop(u_)
  
  # Save
  # torch.save(new, '/Users/ibobby/Dataset/model_weights/BasicVSR/v-bi-fixed.pth')
  print('model_fixed')
  
apis: torch.load