CUDA error: device-side assert triggered CUDA kernel errors问题解决

今天在写pytorch代码的时候,报了这样的一个错误

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.

这个问题的解决只要在前面加上一个指定cuda部分的代码

torch.cuda.set_device(0)

然而问题未解决,最终发现这里是由于padding中出现了-100
此时这里也引出了chinese roberta与bert的一个区别,作为所有的bert、所有的nezha以及chinese roberta模型,后面的padding加上的都是0,而作为english padding模型,padding加上的内容为1,所以chinese roberta直接调用bert即可,目前pythonicforbert库中还尚未解决这一问题,等待着后续的优化使用
这里一个问题出现在,预训练的时候label可以出现-100的数值,但是输入的input不可以出现-100的数值,否则没法通过embedding的网络层

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
usb-device-ccid-project-1.4-iar5-at91sam9263-ek ...............................................\at91lib ...............................................\.......\boards ...............................................\.......\......\at91sam9263-ek ...............................................\.......\......\..............\at91sam9263 ...............................................\.......\......\..............\...........\AT91SAM9263.h ...............................................\.......\......\..............\...........\sdram.icf ...............................................\.......\......\..............\...........\sram.icf ...............................................\.......\......\..............\board.h ...............................................\.......\......\..............\board_cstartup_iar.s ...............................................\.......\......\..............\board_lowlevel.c ...............................................\.......\......\..............\board_memories.c ...............................................\.......\......\..............\board_memories.h ...............................................\.......\components ...............................................\.......\..........\iso7816 ...............................................\.......\..........\.......\iso7816_3.h ...............................................\.......\..........\.......\iso7816_4.c ...............................................\.......\..........\.......\iso7816_4.h ...............................................\.......\peripherals ...............................................\.......\...........\aic ...............................................\.......\...........\...\aic.c ...............................................\.......\...........\...\aic.h ...............................................\.......\...........\dbgu ...............................................\.......\...........\....\dbgu.c ...............................................\.......\...........\....\dbgu.h ...............................................\.......\...........\pio ...............................................\.......\...........\...\pio.c ...............................................\.......\...........\...\pio.h ...............................................\.......\...........\...\pio_it.c ...............................................\.......\...........\...\pio_it.h ...............................................\.......\...........\pit ...............................................\.......\...........\...\pit.c ...............................................\.......\...........\...\pit.h ...............................................\.......\...........\usart ...............................................\.......\...........\.....\usart.c ...............................................\.......\...........\.....\usart.h ...............................................\.......\usb ...............................................\.......\...\common ...............................................\.......\...\......\core ...............................................\.......\...\......\....\USBConfigurationDescriptor.c ...............................................\.......\...\......\....\USBConfigurationDescriptor.h ...............................................\.......\...\......\....\USBDeviceDescriptor.h ...............................................\.......\...\......\....\USBDeviceQualifierDescriptor.h ...............................................\.......\...\......\....\USBEndpointDescriptor.c ...............................................\.......\...\......\....\USBEndpointDescriptor.h ...............................................\.......\...\......\....\USBFeatureRequest.c ...............................................\.......\...\......\....\USBFeatureRequest.h ...............................................\.......\...\......\....\USBGenericDescriptor.c ...............................................\.......\...\......\....\USBGenericDescriptor.h ...............................................\.......\...\......\....\USBGenericRequest.c ...............................................\.......\...\......\....\USBGenericRequest.h ...............................................\.......\...\......\....\USBGetDescriptorRequest.c ...............................................\.......\...\......\....\USBGetDescriptorRequest.h ...............................................\.......\...\......\....\USBInterfaceDescriptor.h ...............................................\.......\...\......\....\USBInterfaceRequest.c ...............................................\.......\...\......\....\USBInterfaceRequest.h ...............................................\.......\...\......\....\USBSetAddressRequest.c ...............................................\.......\...\......\....\USBSetAddressRequest.h ...............................................\.......\...\......\....\USBSetConfigurationRequest.c ...............................................\.......\...\......\....\USBSetConfigurationRequest.h ...............................................\.......\...\......\....\USBStringDescriptor.h ...............................................\.......\...\device ...............................................\.......\...\......\ccid ...............................................\.......\...\......\....\cciddriver.c ...............................................\.......\...\......\....\cciddriver.h ...............................................\.......\...\......\....\cciddriverdescriptors.h ...............................................\.......\...\......\core ...............................................\.......\...\......\....\USBD.h ...............................................\.......\...\......\....\USBDCallbacks.h ...............................................\.......\...\......\....\USBDCallbacks_Initialized.c ...............................................\.......\...\......\....\USBDCallbacks_RequestReceived.c ...............................................\.......\...\......\....\USBDCallbacks_Reset.c ...............................................\.......\...\......\....\USBDCallbacks_Resumed.c ...............................................\.......\...\......\....\USBDCallbacks_Suspended.c ...............................................\.......\...\......\....\USBDDriver.c ...............................................\.......\...\......\....\USBDDriver.h ...............................................\.......\...\......\....\USBDDriverCallbacks.h ...............................................\.......\...\......\....\USBDDriverCallbacks_ConfigurationChanged.c ...............................................\.......\...\......\....\USBDDriverCallbacks_InterfaceSettingChanged.c ...............................................\.......\...\......\....\USBDDriverDescriptors.h ...............................................\.......\...\......\....\USBD_OTGHS.c ...............................................\.......\...\......\....\USBD_UDP.c ...............................................\.......\...\......\....\USBD_UDPHS.c ...............................................\.......\utility ...............................................\.......\.......\assert.h ...............................................\.......\.......\led.c ...............................................\.......\.......\led.h ...............................................\.......\.......\math.c ...............................................\.......\.......\math.h ...............................................\.......\.......\trace.h ...............................................\at91sam9263-ek ...............................................\..............\usb-device-ccid-project ...............................................\..............\.......................\ewp ...............................................\..............\.......................\...\at91sam9263-ek.ewd ...............................................\..............\.......................\...\at91sam9263-ek.ewp ...............................................\..............\.......................\main.c ...............................................\..............\.......................\usb-device-ccid-project.eww ...............................................\doc ...............................................\...\css ...............................................\...\...\style.css

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值