在Pytorch-Lightning中,您通常不必指定cuda或gpu。RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu那么,我要如何改变torch.normal,使火把-闪电正常工作呢?因为我在cpu和gpu的不同机器上使用这些代码。centers =
我正在尝试运行一个需要pytorch-gpu的python包。我已经将我的Colab笔记本的运行时类型更改为GPU。当我运行该命令时,我会遇到以下错误。不确定我是否可以自己在colab上构建pytorch?_check_cuda_versionRuntimeError: Detected that PyTorchPyTorc
我一直致力于在GPU中训练我的PyTorch模型。不过,该模型在CPU中工作得很好。我一直在使用谷歌Colab的GPU资源来使用cuda。我知道,为了在GPU中运行一个模型,“模型”、“输入功能”和“目标”需要在“cuda”设备中。但是,无论我在代码中做了什么,我要么一直得到错误:
RuntimeError: Input and hidden tensors are not at