调试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. 【nginx】代理设置Host

    旧文章从语雀迁移过来,原日期为2021-02-18 nginx 的 proxy 模块使我们经常会用到的模块之一,比如我们常用的 nginx 反向代理. 反向代理我们一般有这么几行配置代码: locat ...

  2. 使用Springboot+redis+Vue实现秒杀的一个Demo

    目录 1.Redis简介 2.实现代码 3.启动步骤 4.使用ab进行并发测试 5.线程安全 6.总结 7.参考资料 1.Redis简介 Redis是一个开源的key-value存储系统. Redis ...

  3. 来自一位十年.net研发老人的吐血整理:.Net技术栈-网址导航

    业余时间为什么整理这个? 内容聚合:不用一个一个搜索,我们很快可以进入常用技术官网 提高效率:多看官方文档可以最快,最准确的掌握相关的技术资讯,不用被一些没理解透或者有偏差的技术分享所带偏. 很多有经 ...

  4. MasaFramework -- i18n (国际化)

    概念 作为一个普通开发者, 我们负责的项目的使用群体大多数是本国的人民, 但不可避免的也有一些做外贸的业务或者给外企做的项目, 这个时候就要求我们的项目有服务全球客户的能力, 而一个支持国际化能力的框 ...

  5. [seaborn] seaborn学习笔记12-绘图实例(4) Drawing example(4)

    文章目录 12 绘图实例(4) Drawing example(4) 1. Scatterplot with varying point sizes and hues(relplot) 2. Scat ...

  6. ffmpeg常用操作

    音频常用操作 常见的ffmpeg音频参数 常用参数解释: - i 表示input,即输入文件 - f 表示format,即输出格式 - vn 表示vedio not,即输出不包含视频 - ar 设定采 ...

  7. 初始化一个GCP项目并用gcloud访问操作

    1 简介 谷歌云GCP(Google Cloud Platform)是由Google提供的云平台,还是为用户提供了许多免费的产品,还是可以尝试一下的.对于学习或者小项目,都可以使用. 2 创建一个新项 ...

  8. LIS求解(包括优化)

    首先,让我来看看LIS问题 Description 一个数的序列 bi,当 b1 < b2 < ... < bS 的时候,我们称这个序列是上升的.对于给定的一个序列(a1,a2,.. ...

  9. C Primer Plus (6.16) 編程練習

    /*C Primer Plus (6.15) 6*/ 1 #include<stdio.h> 2 int main() 3 { 4 int i,j; 5 for(int i=0;i< ...

  10. Vue+elementui前后端分离,单个图片文件上传和上传时出现的跨域问题的解决方案

    在后端解决跨域问题: 我是通过配置文件来解决跨域问题的 @Configurationpublic class CorsConfig {//解决前后端分离的跨域问题! /** * cors suppor ...