AttributeError module ‘torch._C‘ has no attribute ‘_cuda_setDevice‘
在安装Pytorch时如果cpu版本的,不是gpu版本的。会提示AttributeError module 'torch._C' has no attribute '_cuda_setDevice',所以,需要在python命令后面加上--gpu_ids -1,问题解决。运行如下命令,问题就解决了。python train.py --data_dir sample_dataset--gpu_ids
·
在安装Pytorch时如果cpu版本的,不是gpu版本的。会提示AttributeError module 'torch._C' has no attribute '_cuda_setDevice',所以,需要在python命令后面加上 --gpu_ids -1,问题解决。
运行如下命令,问题就解决了。
python train.py --data_dir sample_dataset --gpu_ids -1
或者,也可以在文件中,直接把参数gpu_ids的默认值改成-1。
欢迎来到FlagOS开发社区,这里是一个汇聚了AI开发者、数据科学家、机器学习爱好者以及业界专家的活力平台。我们致力于成为业内领先的Triton技术交流与应用分享的殿堂,为推动人工智能技术的普及与深化应用贡献力量。
更多推荐

所有评论(0)