为了账号安全,请及时绑定邮箱和手机立即绑定

如何摆脱 GPT-2 警告消息?

如何摆脱 GPT-2 警告消息?

函数式编程 2023-06-27 10:35:29
每次运行 GPT-2 时,我都会收到此消息。有什么办法可以让它消失吗?Some weights of GPT2LMHeadModel were not initialized from the model checkpoint at gpt2 and are newly initialized: ['h.0.attn.masked_bias', 'h.1.attn.masked_bias', 'h.2.attn.masked_bias', 'h.3.attn.masked_bias', 'h.4.attn.masked_bias', 'h.5.attn.masked_bias', 'h.6.attn.masked_bias', 'h.7.attn.masked_bias', 'h.8.attn.masked_bias', 'h.9.attn.masked_bias', 'h.10.attn.masked_bias', 'h.11.attn.masked_bias', 'lm_head.weight'] You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.

1 回答

?
Smart猫小萌

TA贡献1911条经验 获得超7个赞

是的,您需要在从转换器库导入任何内容之前更改日志级别:

import logging

logging.basicConfig(level='ERROR')


from transformers import GPT2LMHeadModel


model = GPT2LMHeadModel.from_pretrained('gpt2')


查看完整回答
反对 回复 2023-06-27

没有找到匹配的内容?试试慕课网站内搜索吧

添加回答

代码语言

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号