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。如下图所示,也可以解决问题。

AttributeError: module 'torch._C' has no attribute '_cuda_setDevice'(在python命令后面加上 --gpu_ids -1)相关推荐

  1. 导入torchvision出现:AttributeError: module ‘torch.jit‘ has no attribute ‘unused‘错误

    导入torchvision出现:AttributeError: module 'torch.jit' has no attribute 'unused'错误 文章目录: 1 问题原因 2 解决方法 我 ...

  2. 成功解决AttributeError: module 'torch.utils' has no attribute 'data'

    成功解决AttributeError: module 'torch.utils' has no attribute 'data' 目录 解决问题 解决思路 解决方法 解决问题 AttributeErr ...

  3. AttributeError: module 'torch.nn' has no attribute 'LocalResponseNorm'问题的解决办法

    错误如下: AttributeError: module 'torch.nn' has no attribute 'LocalResponseNorm' 错误原因: 我在Windows装的pytorc ...

  4. AttributeError: module ‘torch.distributed‘ has no attribute ‘_all_gather_base‘

    问题描述 安装完apex后,调用的是时候出现如下错误: File "/home/shuyuan/anaconda3/envs/shuyuan/lib/python3.8/site-packa ...

  5. 运行pytorch时报错——AttributeError: module 'torch.nn' has no attribute 'ModuleDict'

    2020.2月的最后两个多小时,下次相遇2.29号就要等到四年后了-- 很神奇的一个月,学生生涯的最后一个假期,没想到竟是最长的一次...还是想祝福每位朋友,无论这段时间境况如何,都要稳稳地走下去,生 ...

  6. 关于AttributeError: module ‘torch.nn‘ has no attribute ‘Moudle‘的解决方法

    注意拼写! 注意拼写! 注意拼写! 注意看看U是第几个字母 是 Mo-du-le 不是moudle

  7. AttributeError: module ‘torch‘ has no attribute ‘inference_mode‘

    在运行论文源码时弹出AttributeError: module 'torch' has no attribute 'inference_mode' 异常 原因是pytorch版本问题 torch.i ...

  8. AttributeError: module 'torch.nn.init' has no attribute 'zeros_'

    问题 File "E:\wj-lab\expStad\model.py", line 50, in __init__feat_block.apply(weights_init_ka ...

  9. AttributeError: module 'torch' has no attribute 'rand'

    1. 参考:https://blog.csdn.net/Gao_YaJ/article/details/89578673?depth_1-utm_source=distribute.pc_releva ...

  10. AttributeError: module ‘torchtext.data‘ has no attribute ‘Field‘ 解决

    AttributeError: module 'torchtext.data' has no attribute 'Field' 前言 伴随着 3月5日TorchText 0.9.0更新,一些API调 ...

最新文章

  1. 谷歌新研究对神经网络数据并行性提出质疑
  2. ios cordova报gap://ready 弹出框,一直弹
  3. 二十一、Hadoop学记笔记————kafka的初识
  4. Mvc 页面缓存 OutputCache VaryByCustom
  5. Redis 的应用场景
  6. 1048 Find Coins
  7. java message_Java Message System简介
  8. linux sed 冒号,linux sed 总结
  9. 软件史上最伟大的十大程序员
  10. 2011年华科计算机考研复试笔试算法、数据库(回忆版)
  11. 通信模块开发 c语言,I2C通信模块c语言库文件
  12. 【Java】JDK8新特性之方法引用
  13. Flex RIA的ArcIMS WebGIS之路(一)--胸中的那棵竹
  14. python样本不均衡_三招提拔数据不均衡模子的机能(附python代码)
  15. 【研发设计】多人开发模式下的Git工作流介绍
  16. 基于vb的mysql管理系统代码_VB ACCESS高校财务管理系统[论文 源代码 可执行程序]...
  17. AutoCAD LT 2020 for Mac在升级了MacOS 11后打不开了怎么处理?那么教程来了哦
  18. win7 IIS安装与配置
  19. html 超出shengl,逃不掉(GL)作者:乔禾若
  20. 什么是传递函数模型?

热门文章

  1. 返回固定页面的http服务器
  2. 简化Simulink的建模与模型重构
  3. Atitit jdk net golang sdk标准库对比 Atitit sdk封装的艺术 艾提拉著 1. 重要模块8个 1 1.1. Collections集合,core,net,io,
  4. atitit 高扩展性解决方案 功能扩展法 v2 t66.docx atitit 高扩展性解决方案.docx 1. 功能扩展 vs 性能扩展 2 1.1.       人无远虑,必有近忧。
  5. Atitit 调用另外语言的功能 目录 1. Waht 常见的语言java python js sql xml h5 c# php等之间的互相调用 1 2. 为什么需要互相调用why 1 3. 常
  6. Atitit uri url格式规范与解析器 .URIparser 理解URI和URL的区别,我们引入URN这个概念。 URI = Universal Resource Identifier 统一资
  7. Atitit 软件项目系统托盘图标解决方案
  8. Atitit.ALT+TAB没反应车and 点击任务栏程序闪烁但是不能切换
  9. paip. sip module implements API v10.0 to v10.1 but the PyQt4.QtCore module requires API v9.2
  10. paip.数据库全文检索 attilax总结