当前位置:网站首页>RuntimeError: CUDA error: CUBLAS_ STATUS_ ALLOC_ Failed when calling `cublascreate (handle) `problem solving
RuntimeError: CUDA error: CUBLAS_ STATUS_ ALLOC_ Failed when calling `cublascreate (handle) `problem solving
2022-07-07 07:05:00 【Go crazy first.】
One 、 Problem description
Use transformers package call pytorch Framework of the Bert When training the model , Use normal bert-base-cased Run normally on other datasets , But use it Roberta But always report errors :RuntimeError: CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling `cublasCreate(handle)`
I worked hard for several days and didn't find out what the mistake was , Keep reminding Online batch_size Is it too big to cause , It is amended as follows 16->8->4->2 It's no use .
By comparing with other data sets , Find me in tokenizer Added new special_token, This may lead to the wrong report !

Two 、 Problem solving
In the original tokenizer Add special_tokens when , Forget to model Of tokenizer Update the vocabulary of Lead to !
The complete update method is :
from transformers import BertTokenizer, BertModel
tokenizer = BertTokenizer.from_pretrained('bert-base-cased')
# Add special words
tokenizer.add_special_tokens({'additional_special_tokens':["<S>"]})
model = BertModel.from_pretrained("bert-base-cased")
# Update the size of the thesaurus in the model !
# important !
model.resize_token_embeddings(len(tokenizer))3、 ... and 、 Problem solving
Can pass , Start training !

边栏推荐
- Kotlin之 Databinding 异常
- Basic introduction of JWT
- How can flinksql calculate the difference between a field before and after update when docking with CDC?
- LC 面试题 02.07. 链表相交 & LC142. 环形链表II
- 毕业设计游戏商城
- MATLAB小技巧(30)非线性拟合 lsqcurefit
- 大咖云集|NextArch基金会云开发Meetup来啦
- DB2获取表信息异常:Caused by: com.ibm.db2.jcc.am.SqlException: [jcc][t4][1065][12306][4.25.13]
- 大促过后,销量与流量兼具,是否真的高枕无忧?
- 如何给目标机器人建模并仿真【数学/控制意义】
猜你喜欢

Brand · consultation standardization

毕业设计游戏商城

. Net 5 fluentftp connection FTP failure problem: this operation is only allowed using a successfully authenticated context

Answer to the first stage of the assignment of "information security management and evaluation" of the higher vocational group of the 2018 Jiangsu Vocational College skills competition

. Net core accesses uncommon static file types (MIME types)

ANR 原理及实践

学术报告系列(六) - Autonomous Driving on the journey to full autonomy

Several index utilization of joint index ABC

main函数在import语句中的特殊行为

2022年全国所有A级景区数据(13604条)
随机推荐
toRefs API 与 toRef Api
Bus message bus
Prompt for channel security on the super-v / device defender side when installing vmmare
Sqlserver multithreaded query problem
Basic introduction of JWT
Initial experience of addresssanitizer Technology
精准时空行程流调系统—基于UWB超高精度定位系统
from .onnxruntime_pybind11_state import * # noqa ddddocr运行报错
Sword finger offer high quality code
Jmeter 5.5版本发布说明
This article introduces you to the characteristics, purposes and basic function examples of static routing
Tool class: object to map hump to underline underline hump
How to do sports training in venues?
Composition API 前提
Leetcode T1165: 日志分析
根据IP获取地市
Stack and queue-p78-8 [2011 unified examination true question]
MySQL view bin log and recover data
. Net 5 fluentftp connection FTP failure problem: this operation is only allowed using a successfully authenticated context
健身房如何提高竞争力?