AttributeError: module 'torch._C' has no attribute '_cuda_setDevice'(在python命令后面加上 --gpu_ids -1)
1. 问题:AttributeError: module 'torch._C' has no attribute '_cuda_setDevice'运行命令python train.py --data_dir sample_data时,出现上述错误。2. 参考:https://github.com/KupynOrest/DeblurGAN/issues/74从这里知道了下一个链...
1. 问题:AttributeError: module 'torch._C' has no attribute '_cuda_setDevice'
运行命令python train.py --data_dir sample_data时,出现上述错误。

2. 参考:
https://github.com/KupynOrest/DeblurGAN/issues/74 从这里知道了下一个链接
https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/issues/67 有一个解决办法:

https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/issues/360


3. 解决:
我安装的Pytorch时cpu版本的,不是gpu版本的。所以,需要在python命令后面加上 --gpu_ids -1,问题解决。
那么,运行命令:python train.py --data_dir sample_dataset --gpu_ids -1,我的问题就解决了。
或者,也可以在文件中,直接把参数gpu_ids的默认值改成-1。如下图所示,也可以解决问题。

欢迎来到FlagOS开发社区,这里是一个汇聚了AI开发者、数据科学家、机器学习爱好者以及业界专家的活力平台。我们致力于成为业内领先的Triton技术交流与应用分享的殿堂,为推动人工智能技术的普及与深化应用贡献力量。
更多推荐


所有评论(0)