PyTorch下,使用list放置模块,导致计算设备不一的报错

报错 在复现 Transformer 代码的训练阶段时,发生报错: RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! 解决方案 通过
posted @ 2024-02-04 19:09  zh-jp  阅读(24)  评论(0编辑  收藏  举报