[debug] RuntimeError: “nll_loss_forward_reduce_cuda_kernel_2d_index“ not implemented for ‘Int‘
问题描述
在使用nn.CrossEntropyLoss
时出现报错:
loss_id = self.IDLoss(id_preds, id_targets)
Traceback (most recent call last):File "/home/hgx/pycharm-2020.1.3/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_exec2.py", line 3, in Execexec(exp, global_vars, local_vars)File "<input>", line 1, in <module>File "/home/hgx/anaconda3/envs/bytetrack/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_implreturn forward_call(*input, **kwargs)File "/home/hgx/anaconda3/envs/bytetrack/lib/python3.7/site-packages/torch/nn/modules/loss.py", line 1152, in forwardlabel_smoothing=self.label_smoothing)File "/home/hgx/anaconda3/envs/bytetrack/lib/python3.7/site-packages/torch/nn/functional.py", line 2846, in cross_entropyreturn torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing)
RuntimeError: "nll_loss_forward_reduce_cuda_kernel_2d_index" not implemented for 'Int'
问题分析
数据类型导致的错误
解决方案
进行数据类型转换
id_targets = id_targets.to(torch.int64) # TODO: ReID. [matched_anchor], float16 to int
[debug] RuntimeError: “nll_loss_forward_reduce_cuda_kernel_2d_index“ not implemented for ‘Int‘相关推荐
- RuntimeError: “unfolded2d_copy“ not implemented for ‘Half‘(实测百分百有效)
报错 RuntimeError: "unfolded2d_copy" not implemented for 'Half' 原因 模型传入的参数use_half=true,就是利用 ...
- [debug] RuntimeError: CUDA error: no kernel image is available for execution on the device
问题描述 运行程序时出现报错: RuntimeError: CUDA error: no kernel image is available for execution on the device ( ...
- RuntimeError: “LayerNormKernelImpl“ not implemented for ‘Long‘
将GitHUB上下载的模块用于自己的模型,一定要注意输入数据的数据类型(dtype)是否满足模块的要求 第一步:数据类型为张量:train_inputs=torch.tensor(train_inpu ...
- YOLOv5+deepsort——报错解决:RuntimeError: “unfolded2d_copy“ not implemented for ‘Half‘
一.报错原因 CPU不支持半精度训练 二.解决办法 要么采用GPU训练 要么将检测模块中的.half()全部改成.float()(计算时请保证数据类型一致)
- python个人bug修炼手册
文章目录 问题一:python: can't open file 'argparse_learning_1.py': [Errno 2] No such file or directory 问题二:M ...
- 64位Fedora运行32位C++程序中int精度溢出处理
在64-bit机器中编译32-bit的代码出现int(强制转换而至)精度溢出: Debug==> error: cast from 'void*' to 'int' loses precisio ...
- 从C#中的枚举获取int值
我有一堂课,叫做Questions (复数). 在此类中,有一个名为Question (单数)的枚举,它看起来像这样. public enum Question {Role = 2,ProjectFu ...
- 区分Debug版还是Relase版
// test.cpp : 区分Debug版还是Relase版 // #include "stdafx.h" //提示使用Debug环境会定义宏_DEBUG int _tmain( ...
- DEBUG命令的应用
TAG:随笔杂记 下面对一些常用指令进行详细剖析: A (Assemble) 汇编指令 1,输入汇编语句被汇编到内存的指定区段,此区段在开始时用A address 指定. 2,所有语句输入完成后,按E ...
最新文章
- windows10远程控制 电脑,远程桌面
- java中字符与字节的编码关系
- angr学习笔记(11)(SimProcedure)
- Boost:原子API的用法测试程序
- sap 标准委外和工序委外_「SAP技术」SAP MM 委外加工采购流程里副产品的收货
- hdu 2586(LCA的离线做法)
- (十)webpack 和 babel
- 第二章:方法区和运行时常量池溢出
- Duilib编辑框Edit输入完自动跳到下一个编辑框
- 使用java实现面向对象编程第二章_java面向对象编程——第二章 java基础语法
- 【算法与数据结构】哈希表-链地址法
- IDEA 2019 激活码(注册码)
- 幼儿园语言活动包括哪几类_幼儿园语言活动形式有哪些
- python寒假培训第二课
- Spring Boot配置文件---约定大于配置
- 什么是c语言系统调用,什么是系统调用?为什么要用系统调用?
- ra寄存器定位core
- 宁乡首届春耕节开幕,在寓教于乐中弘扬传统文化
- WebSocket:响应头‘Sec-WebSocket-Accept‘的生成
- 88steam@88skins CSGO饰品皮肤开箱DOTA2饰品开箱即开即取网站
热门文章
- python自动化办公实例-python自动化测试实例解析
- vue根据屏幕大小适配表格高度
- element时间范围选择添加限制条件
- oracle10g无监听配置文件,关于监听配置文件listener.ora的问题
- 最简单的基于DirectShow的示例:视频播放器图形界面版
- 8运行不了_民航局暂停运行737max8,分析可能因为“它”导致飞机俯冲坠落
- Linux C语言解析 yaml,c – 用yaml cpp解析yaml
- mysql在文件里修改用户_mysql用户密码修改,用户添加、删除、设置权限及源文件恢复数据库...
- Navicat 连接MySQL 8.0.11 出现2059错误
- HDOJ水题集合6:杂题