【问题标题】:How to Get Rid of GPT-2 Warning Message?如何摆脱 GPT-2 警告信息?
【发布时间】:2020-12-16 22:17:59
【问题描述】:

每次运行 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.

【问题讨论】:

标签: python huggingface-transformers gpt-2


【解决方案1】:

是的,您需要更改 loglevel 在从转换器库中导入任何内容之前

import logging
logging.basicConfig(level='ERROR')

from transformers import GPT2LMHeadModel

model = GPT2LMHeadModel.from_pretrained('gpt2')

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-11-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-25
    相关资源
    最近更新 更多