【发布时间】:2023-02-16 09:24:22
【问题描述】:
早些时候我已经配置了以下项目
https://github.com/zllrunning/face-makeup.PyTorch
使用带有 CUDA=10.2 的 Pytorch,现在带有 CUDA=10.2 支持的 Pytorch 不适用于 Windows。 因此,当我使用带有 CUDA=11.3 的 Pytorch 配置同一个项目时,出现以下错误:
RuntimeError: Attempted to set the storage of a tensor on device "cuda:0" to a storage on different device "cpu". This is no longer allowed; the devices must match.
请帮我解决这个问题。
【问题讨论】:
-
正如错误明确指出的那样,您将必须修改项目以使用当前的 PyTorch 语义来管理存储数据的内存空间。这无论如何都不是与 CUDA 相关的问题,它只是试图在现代版本的 Pytorch 上运行过时的代码。