It has been solved by adding dimension
o_p_ref=o_p_ref.unsqueeze(dim=0)
# print(o_p_ref.shape) # torch.Size([1, 1, 224, 224])

o_p_ref=F.interpolate(o_p_ref, size=(ori_img_s[0],ori_img_s[1]))
# torch.Size([1, 1, 341, 512])