当前位置:网站首页>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 !
边栏推荐
- Installing redis and windows extension method under win system
- Use of completable future
- 请教一个问题,flink oracle cdc,读取一个没有更新操作的表,隔十几秒就重复读取全量数据
- ESXI挂载移动(机械)硬盘详细教程
- From zero to one, I will teach you to build the "clip search by text" search service (2): 5 minutes to realize the prototype
- 非父子组件的通信
- 分布式id解决方案
- ip地址那点事
- Config distributed configuration center
- LVS+Keepalived(DR模式)学习笔记
猜你喜欢
How to share the same storage among multiple kubernetes clusters
After the promotion, sales volume and flow are both. Is it really easy to relax?
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
2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书第二阶段答案
How to install swoole under window
MOS管参数μCox得到的一种方法
Stack and queue-p78-8 [2011 unified examination true question]
Prime partner of Huawei machine test questions
Lvs+kept (DR mode) learning notes
Config distributed configuration center
随机推荐
[GNN] graphic gnn:a gender Introduction (including video)
算法---比特位计数(Kotlin)
from . onnxruntime_ pybind11_ State Import * noqa ddddocr operation error
leetcode 509. Fibonacci Number(斐波那契数字)
【mysqld】Can't create/write to file
Comment les entreprises gèrent - elles les données? Partager les leçons tirées des quatre aspects de la gouvernance des données
请教一个问题,flink oracle cdc,读取一个没有更新操作的表,隔十几秒就重复读取全量数据
Networkx绘图和常用库函数坐标绘图
学术报告系列(六) - Autonomous Driving on the journey to full autonomy
Advantages of using net core / why
健身房如何提高竞争力?
How can brand e-commerce grow against the trend? See the future here!
多学科融合
AVL树的实现
Matlab tips (30) nonlinear fitting lsqcurefit
main函数在import语句中的特殊行为
$refs:组件中获取元素对象或者子组件实例:
DB2获取表信息异常:Caused by: com.ibm.db2.jcc.am.SqlException: [jcc][t4][1065][12306][4.25.13]
How can gyms improve their competitiveness?
MySQL view bin log and recover data