调试diffusion模型时在loss处报错,报错位置:

`acc_train_loss += loss.item()`

RuntimeError: CUDA error: device-side assert triggered CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

在训练的损失函数位置加了断点,进行调试,发现了 unable to get repr for <class ‘torch.Tensor‘> 的错误信息

参考https://discuss.pytorch.org/t/unable-to-get-repr-for-class-torch-tensor/115627/3,使用cpu运行,报错

out = a.gather(-1, t) RuntimeError: index -1 is out of bounds for dimension 0 with size 10

确实是越界问题,在采样t-1时的样本时,t=0发生越界

修改:添加t = t.clamp_min(0),去除负值

RuntimeError: CUDA error: device-side assert triggered的更多相关文章

  1. Pytorch: cuda runtime error (59) : device-side assert triggered at /pytorch/aten/src/THC/generic/THCTensorMa

    更换了数据集, 在计算交叉熵损失时出现错误 : cuda runtime error (59) : device-side assert triggered at /pytorch/aten/src/ ...

  2. Pytorch报错:cuda runtime error (59) : device-side assert triggered at /pytorch/aten/src/THC/generic/THCTensorMath.cu:26

    Pytorch报错:cuda runtime error (59) : device-side assert triggered at /pytorch/aten/src/THC/generic/TH ...

  3. ubuntu查看并杀死自己之前运行的进程解决办法RuntimeError: CUDA error: out of memory

    问题描述:在跑深度学习算法的时候,发现服务器上只有自己在使用GPU,但使用GPU总是会报RuntimeError: CUDA error: out of memory,这是因为自己之前运行的进程还存在 ...

  4. CUDA Cudnn pytorch 安装及错误 RuntimeError: cuDNN error: CUDNN_STATUS_NOT_INITIALIZED解决

    看我结论,大家试试看最后装pytorch看行不行,不行就去冲了PyTorch   /Doge ubuntu 20.04 下安装CUDA,参考这个博主写的,先看显卡支持的最高CUDA版本,之后找一个较新 ...

  5. android eclipse——error: device not found解决办法

    device not found解决办法 http://www.blogjava.net/anchor110/articles/335866.html 问题描述:在CMD命令行,输入adb shell ...

  6. raise RuntimeError("autoconf error") RuntimeError: autoconf error

    pip 安装模块时遇到下错误,没有粘贴全,差不多都是这样.这个情况是 pip 安装模块 需要 gcc 及 python-devle 支持, ubuntu 是 python-dev ,使用Yum 安装即 ...

  7. read()、write()返回 Input/output error, Device or resource busy解决

    遇到的问题,通过I2C总线读.写(read.write)fs8816加密芯片,报错如下: read str failed,error= Input/output error! write str fa ...

  8. adb shell命令后出现error: device not found错误提示

    在cmd中输入adb shell进入linux shell环境前,需要把android模拟器打开(本文都是针对模拟器而言,并非真机).如果启动好了模拟器,且输入adb shell命令后出现error: ...

  9. adb error: device offline

    adb 调试一直报错 $ adb shell error: device offline 解决办法: $ adb kill-server $ adb start-server * daemon not ...

  10. error: device not found

    C:\Users\Administrator>adb shell error: device not found    出现上面情况,首先检查设备管理器中,安卓的驱动是否安装OK?   如果驱动 ...

随机推荐

  1. js 中常用函数汇总(含示例)

    〇.前言 js 在日常开发中还是比较常用的,本文将常用的 js 方法简单汇总一下,希望对你我有一点帮助. 一.重复 / 延迟操作 1.设置固定时间间隔,重复执行(setInterval(funcRef ...

  2. 洛谷P1434例题分析

    [SHOI2002] 滑雪 题目描述 Michael 喜欢滑雪.这并不奇怪,因为滑雪的确很刺激.可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你.Mic ...

  3. [数学理论] NP问题解释

    转载自http://m.blog.csdn.net/csshuke/article/details/74909562 希望通过这篇文章可以不仅让计算机相关专业的人可以看懂和区分什么是P类问题什么是NP ...

  4. S2-016 CVE-2013-2251

    漏洞名称 S2-016(CVE-2013-2251) 通过操作前缀为"action:"/"redirect:"/"redirectAction:&qu ...

  5. python进阶之路15 之异常处理、生成器相关

    异常捕获处理 1.异常 异常就是代码运行报错 行业术语叫bug 代码运行中一旦遇到异常会直接结束整个程序的运行 我们在编写代码的过程中要尽可能避免 2.异常分类 语法错误 不允许出现 一旦出现立刻改正 ...

  6. 腾讯出品小程序自动化测试框架【Minium】系列(一)环境搭建之第一个测试程序

    一.什么是Minium? minium是为小程序专门开发的自动化框架,使用minium可以进行小程序UI自动化测试. 当然,它的能力不仅仅局限于UI自动化, 比如: 使用minium来进行函数的moc ...

  7. UVA12412 A Typical Homework (a.k.a Shi Xiong Bang Bang Mang)

    简要题意 这道题就是要你维护一个学生成绩管理系统. 代码实现 程序设计 为了方便输出,我们定义了 println 函数: void println(string s){ cout<<s&l ...

  8. Luogu P6394 樱花,还有你题解

    原题链接:樱花,还有你 $\scr{\color{DarkOrchid}{Solution}}$ Subtask1 这是一个送分的:总和都不到$n$,无论怎么收集,花瓣数肯定不到$n$,输出impos ...

  9. (Newtonsoft)Json增删改查

    public static class JsonHelper { #region 字段 private static string json; public static string path; # ...

  10. CSP-J2022游寄

    本人资料 地区:河北-衡水 洛谷账号:xinao2186182144 洛谷ID:747196 前言 这次比赛本来是信心满满,认为自己这半年来的努力与付出都不会付诸东流(还想表个白?算是吧).到了考场的 ...