
问题一:RuntimeError: "upsample_nearest2d_channels_last" not implemented for 'Half'
RuntimeError: "upsample_nearest2d_channels_last" not implemented for 'Half'
这是 PyTorch 框架开启半精度导致的问题,表示你的电脑的 CPU 或 GPU 不支持 Half 参数。开启半精度后能够加快运行速度、减少 GPU 占用,并且只有不明显的 accuracy 损失。原生的 torch 是 32 位浮点型的(float32),我们可以借鉴模型量化的思想,将其变成 16 位浮点型的(float16)加快模型推理速度。