当前位置:网站首页>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 !
边栏推荐
- Master-slave replication principle of MySQL
- Prime partner of Huawei machine test questions
- Multithreading and high concurrency (9) -- other synchronization components of AQS (semaphore, reentrantreadwritelock, exchanger)
- 网络基础 —— 报头、封装和解包
- Anr principle and Practice
- 【luogu P1971】兔兔与蛋蛋游戏(二分图博弈)
- FPGA课程:JESD204B的应用场景(干货分享)
- AddressSanitizer 技术初体验
- Lvs+kept (DR mode) learning notes
- Graduation design game mall
猜你喜欢
Bus消息总线
$refs:组件中获取元素对象或者子组件实例:
企业如何进行数据治理?分享数据治理4个方面的经验总结
Stack and queue-p79-10 [2014 unified examination real question]
ip地址那点事
2018 Jiangsu Vocational College skills competition vocational group "information security management and evaluation" competition assignment
SolidWorks的GB库(钢型材库,包括铝型材、铝管等结构)安装及使用教程(生成铝型材为例)
SVN version management in use replacement release and connection reset
LVS+Keepalived(DR模式)学习笔记
Data of all class a scenic spots in China in 2022 (13604)
随机推荐
readonly 只读
JESD204B时钟网络
Bus message bus
. Net 5 fluentftp connection FTP failure problem: this operation is only allowed using a successfully authenticated context
Anr principle and Practice
请教一个问题,flink oracle cdc,读取一个没有更新操作的表,隔十几秒就重复读取全量数据
Please ask a question, flick Oracle CDC, read a table without update operation, and repeatedly read the full amount of data every ten seconds
Get the city according to IP
Stack and queue-p79-10 [2014 unified examination real question]
The latest trends of data asset management and data security at home and abroad
算法---比特位计数(Kotlin)
Config分布式配置中心
大促过后,销量与流量兼具,是否真的高枕无忧?
impdp的transform参数的测试
MySQL binlog related commands
非父子组件的通信
How to do sports training in venues?
What books can greatly improve programming ideas and abilities?
SolidWorks GB Library (steel profile library, including aluminum profile, aluminum tube and other structures) installation and use tutorial (generating aluminum profile as an example)
请教一下,监听pgsql ,怎样可以监听多个schema和table