脱坑指南

  • 1、问题描述
    • 1.1 第一个
    • 1.2 第二个
  • 2、总结

1、问题描述

1.1 第一个

跑代码发现一个,如标题所示,遇到这个问题的原因是你的pytorch框架版本问题,换成1.3.1就没问题了,或者在报错的地方进行强制类型转换,加上.float(),具体怎么加还是要搜索一下。

1.2 第二个

如果是double类型的错误,那么也可以进行强制转换,在后面加上.double(),查一下Tensor的用法。

2、总结

我会继续补充的,看到这个博客的都是有缘人,再见。

RuntimeError: expected backend CUDA and dtype Float but got backend CUDA and dtype Long相关推荐

  1. RuntimeError: Expected object of backend CUDA but got backend CPU for argument

    RuntimeError: Expected object of backend CUDA but got backend CPU for argument #4 'mat1' 原因:变量没有加cud ...

  2. RuntimeError: Expected object of backend CUDA but got backend CPU for argument #4 'mat1'

    RuntimeError: Expected object of backend CUDA but got backend CPU for argument #4 'mat1' 原因:变量没有加cud ...

  3. 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 ...

  4. 常见报错:RuntimeError: expected scalar type Long but found Float

    RuntimeError: expected scalar type Long but found Float 这是一个非常常见的报错,我已经遇到过这个报错很多次了,但是之前没有仔细研究过,今天好好好 ...

  5. 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 ...

  6. [报错]RuntimeError: expected scalar type Double but found Float(torch)

    RuntimeError: expected scalar type Double but found Float 在使用torch训练模型的时候,发现该问题.根据提示,是双精度和float之间的冲突 ...

  7. RuntimeError: expected scalar type Double but found Float

    最近在使用 sequitur库 快速搭建自编码器时遇到 RuntimeError: expected scalar type Double but found Float 涉及代码 import to ...

  8. 异常解决(一)-- RuntimeError: expected device cpu but got device cuda:0

    最近在编写深度学习的相关代码,基于PyTorch,运行程序的时候,报错,报错内容如下所示: RuntimeError: expected device cpu but got device cuda: ...

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

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

最新文章

  1. [YTU]_2353 ( 长方柱类【C++ 类定义】)
  2. 因式分解,算术基本定理,积性函数(POJ 1452 Happy2004)
  3. AI决策,企业转型新范式
  4. Struct2_定义拦截器并使用注解方式作用在Action的方法中
  5. 【转】怎样成为优秀的软件模型设计者(文末提供下载)
  6. 详解Python中的浅复制与深复制
  7. 微软:攻击者利用SolarWinds Serv-U 0day发动 Log4j 攻击
  8. guava 对集合的支持
  9. 【Flutter】微信项目实战【06】 通讯录界面搭建(中)
  10. 计算机操作系统笔记(五)
  11. java发微信字体颜色,微信公众号 模板消息 字体颜色 错位?
  12. Linux自学之旅-基础命令(Ext4文件系统)
  13. 如何在Ubuntu18.4中设置ERPNEXT开源ERP生产环境开机运行
  14. python中的加减乘除(运算符)
  15. 银行放贷冲动不强:7折房贷利率料最早明年现身
  16. 软文写作技巧,你的微信软文也能破100000+
  17. k-选取问题之快速选取策略quickSelection
  18. 机器学习入门-kNN算法实现手写数字识别
  19. 基于 Arduino 的智能投石机制作
  20. win10家庭版打不开组策略的解决方法和彻底关闭病毒和威胁防护

热门文章

  1. 找出1到n的守形数c语言,c语言循环语句训练题(6页)-原创力文档
  2. postman压力测试_如何用Postman简单做接口自动化
  3. linux备份mysql怎样操作,Linux下自动备份MySQL数据库详细操作步骤(转载)
  4. cmd安装mysql_MySQL windows下cmd安装操作
  5. bert模型可以做文本主题识别吗_网民情绪识别TOP3分享----科技战疫·大数据公益挑战赛...
  6. python个数计算公式_用python计算1-100的合数的个数
  7. matlab 写入 MYSQL_阿里开源MySQL中间件Canal快速入门
  8. Python之 if-elif-else
  9. Python——如何屏蔽函数内部的print输出
  10. ‘python3\r’: No such file or directory