当前位置:网站首页>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 !
边栏推荐
- Composition API 前提
- Learning records on July 4, 2022
- Multithreading and high concurrency (9) -- other synchronization components of AQS (semaphore, reentrantreadwritelock, exchanger)
- DB2获取表信息异常:Caused by: com.ibm.db2.jcc.am.SqlException: [jcc][t4][1065][12306][4.25.13]
- Problems and precautions about using data pumps (expdp, impdp) to export and import large capacity tables in Oracle migration
- 毕业设计游戏商城
- 多学科融合
- 华为机试题素数伴侣
- mysql查看bin log 并恢复数据
- Matlab tips (30) nonlinear fitting lsqcurefit
猜你喜欢
Redhat5 installing vmware tools under virtual machine
Several index utilization of joint index ABC
How to share the same storage among multiple kubernetes clusters
毕业设计游戏商城
7天零基础能考证HCIA吗?华为认证系统学习路线分享
JDBC database connection pool usage problem
精准时空行程流调系统—基于UWB超高精度定位系统
企业如何进行数据治理?分享数据治理4个方面的经验总结
关于数据库数据转移的问题,求各位解答下
Leetcode T1165: 日志分析
随机推荐
main函数在import语句中的特殊行为
mysql查看bin log 并恢复数据
Maze games based on JS
如何给目标机器人建模并仿真【数学/控制意义】
ip地址那点事
RuntimeError: CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling `cublasCreate(handle)`问题解决
场馆怎么做体育培训?
【JDBC以及内部类的讲解】
什么情况下考虑分库分表
MySql用户权限
The latest trends of data asset management and data security at home and abroad
unity3d学习笔记
企業如何進行數據治理?分享數據治理4個方面的經驗總結
. Net 5 fluentftp connection FTP failure problem: this operation is only allowed using a successfully authenticated context
Sword finger offer high quality code
Prime partner of Huawei machine test questions
Complete process of MySQL SQL
Prompt for channel security on the super-v / device defender side when installing vmmare
Kotlin之 Databinding 异常
MySQL user permissions