Based on the posted shapes, I’m initializing the data via:
    channels = 3
    height, width = 224, 224
    views = 2
    cameras = 4
    frames = 1

    #loaded = torch.FloatTensor(np.load('poses_bounds.npy'))
    poses_bounds = torch.randn(1, cameras, 17)#[proc_poses_bounds(x) for x in loaded]
    K = torch.stack([x[0] for x in poses_bounds])
    w2c = torch.stack([x[1] for x in poses_bounds])
    bds = torch.stack([x[2] for x in poses_bounds])

    #tgt_rgb = torch.FloatTensor(np.load('tgt_rgb.npy'))
    tgt_rgb = torch.randn(channels, height, width)
    src_rgb = torch.randn(views, channels, height, width) #torch.FloatTensor(np.load('src_rgb.npy'))
    tgt_bg = torch.randn(frames, channels, height, width) #torch.FloatTensor(np.load('tgt_bg.npy'))
    src_bg = torch.randn(views, frames, channels, height, width) #torch.FloatTensor(np.load('src_bg.npy'))

which raises:
Traceback (most recent call last):
  File "reproduce_bug.py", line 190, in <module>
    net(sample)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 881, in _call_impl
    result = self.forward(*input, **kwargs)
  File "reproduce_bug.py", line 74, in forward
    bg_mpi = self.gen_mpi(self.mpi_net, src_bg, src_exts, src_ints, depths)
  File "reproduce_bug.py", line 114, in gen_mpi
    b, v, c, h, w = src_imgs.shape
ValueError: too many values to unpack (expected 5)

I have thus removed the unsqueeze from src_bg, but get the next error:
Traceback (most recent call last):
  File "reproduce_bug.py", line 191, in <module>
    net(sample)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 881, in _call_impl
    result = self.forward(*input, **kwargs)
  File "reproduce_bug.py", line 74, in forward
    bg_mpi = self.gen_mpi(self.mpi_net, src_bg, src_exts, src_ints, depths)
  File "reproduce_bug.py", line 119, in gen_mpi
    psv_src = src_exts.reshape([-1, 4, 4])
RuntimeError: shape '[-1, 4, 4]' is invalid for input of size 2

Could you check the shapes again, please?