原因是没有把输入数据类型转为float类型

首先找到代码出错的位置,将该处的数据类型转为float类型:

x = x.type(torch.FloatTensor)

Input type (torch.cuda.DoubleTensor) and weight type (torch.cuda.FloatTensor) should be the same相关推荐

  1. Pytorch数据使用列表的卷积层时报错及解决-RuntimeError: Input type (torch.cuda.HalfTensor) and weight type (torch.Floa

    文章首发及后续更新:https://mwhls.top/3737.html,无图/无目录/格式错误/更多相关请至首发页查看. 新的更新内容请到mwhls.top查看. 欢迎提出任何疑问及批评,非常感谢 ...

  2. 错误处理:RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be

    使用torchsummary的时候,出现以下错误: (涉及板块: python 库整理:Timm(1)_UQI-LIUWJ的博客-CSDN博客 pytorch 笔记:torchsummary_UQI- ...

  3. Pytorch出现RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor)

    这个问题的主要原因是输入的数据类型与网络参数的类型不符. Input type为torch.cuda.FloatTensor(GPU数据类型), weight type(即net.parameters ...

  4. Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same(解决)

    问题描述 在使用pytorch训练经典的MNIST数据集时,运行时,出现了以下的问题: Input type (torch.FloatTensor) and weight type (torch.cu ...

  5. 【BUG解决】 RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor)

    问题描述 RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be ...

  6. RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the

    运行时出现这个错误:RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) shou ...

  7. RuntimeError_ Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor)

    两个解决方案 方案一:检查网络和数据是否都在GPU上 RuntimeError:输入类型(torch.FloatTensor)和权重类型(torch.cuda.FloatTensor)应该相同,或者输 ...

  8. RuntimeError: Expected object of type torch.cuda.LongTensor but found type torch.cuda.IntTensor

    问题: anchor_label = np.array(self.id_dict[int(anchor_id)])identity_loss = criterion_identity(predicte ...

  9. RuntimeError: Expected object of device type cuda but got device type cpu for argument pytorch数据位置

    RuntimeError: Expected object of device type cuda but got device type cpu for argument #2 'target' i ...

最新文章

  1. Vs2005 正在更新 IntelliSense无法通过的解决办法
  2. Flink SQL Client的Rolling Aggregation实验解析
  3. 接口使用jwt返回token_API接口JWT方式的Token认证(下),客户端(Android)的实现
  4. 验证授权【msdn】
  5. Java http处理get请求,参数中带特殊字符处理方式
  6. Alluxio2.X简要介绍
  7. WebRTC入门知识
  8. 模板模式 php,PHP设计模式5-模板模式
  9. 程序员接私活必备的 10 个开源项目!
  10. linux mk文件6,linux_2.6.30.4_Makefile_3--Makefile学习笔记
  11. svn中文扩展包安装
  12. 如何将Win7、Win10笔记本,台式机系统C盘软件搬家? 只需3个步骤!!!
  13. 【Python】基于Python的百度迁徙2——迁徙规模指数(附代码)
  14. 知网HTML阅读是什么,HTML – 屏幕阅读器究竟是什么?我应该如何处理我的网站?...
  15. ROS学习笔记---ros的通信机制
  16. 前端学习之路, 记录前端小白成长历程, 学习总结, 工具汇总, 打造开箱即用的学习体验
  17. VLAN 基础实验2:VLAN 应用Hybird接口
  18. Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat
  19. 公钥、私钥、加密、解密
  20. TVBox原代码及分享地址

热门文章

  1. JAVA校内报纸实验_实验(实训)中心2011—2012学年第二学期工作计划
  2. redis如何设置定时过期_redis补充6之Redis 设置过期时间
  3. 写给我的女神,一个用灵魂歌唱的小精灵
  4. 2020年8个效率最高的爬虫框架
  5. 战略性基础研究的由来及国际实践研究
  6. 爬虫基本库request使用—爬取猫眼电影信息
  7. CentOS7完成mysql的安装和远程访问
  8. 计蒜客 28437.Big brother said the calculation-线段树+二分-当前第k个位置的数 ( ACM训练联盟周赛 M)...
  9. mysql 序列号生成器 (自定义函数)
  10. root 链接ftp