RuntimeError: The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimension 0 读取格式不对 改正方法: image = Image.open(image_path).convert('RGB') 需要转RGB模式