大佬教程收集整理的这篇文章主要介绍了Spyder应用技巧,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
————解决PyTorch的相关问题
2)如果PyTorch是CPU方式,可以改_ _init.py_ _:
def set_device(device: _device_t) -> None: r"""Sets the current device. Usage of this function is discouraged in favor of :any:`device`. In most cases it's better to use ``CUDA_VISIBLE_DEVICES`` environmental variable. Args: device (torch.device or @R_673_10185@: SELEcted device. This function is a no-op if this argument is negative. """ device = _get_device_index(devicE) if Device >= 0: #torch._C._cuda_setDevice(devicE) torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
最后通过搜索“Win10+Anaconda安装CPU版本Pytorch与GPU版Pytorch”,找到相关的测试程序。
以上是大佬教程为你收集整理的Spyder应用技巧全部内容,希望文章能够帮你解决Spyder应用技巧所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。