RuntimeError: cannot pin 'torch.cuda.FloatTensor' only dense CPU tensors can be pinned

RuntimeError: cannot pin 'torch.cuda.FloatTensor' only dense CPU tensors can be pinned

参考博客:https://blog.csdn.net/qq_36607894/article/details/103277381

参考博客:https://blog.csdn.net/weixin_45019478/article/details/112757603

我最终是把那个pin_memory=Fasle和workers_number=0过了的,感觉是因为我在dataset的getitem中使用了torch.load导致的,也不太懂。。。。。

文章目录