Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行main.py和predict.py时都出现如下警告 #32

Open
Amberpollar opened this issue May 14, 2024 · 3 comments
Open

运行main.py和predict.py时都出现如下警告 #32

Amberpollar opened this issue May 14, 2024 · 3 comments

Comments

@Amberpollar
Copy link

大佬,运行时出现警告,BERT模型权重未使用。请问怎么解决?

(torchenv) D:\KG\BERT-BILSTM-CRF-main\BERT-BILSTM-CRF-main>python main.py
['O', 'B-故障设备', 'I-故障设备', 'B-故障原因', 'I-故障原因']
{'O': 0, 'B-故障设备': 1, 'I-故障设备': 2, 'B-故障原因': 3, 'I-故障原因': 4}
Some weights of the model checkpoint at ./model_hub/chinese-bert-wwm-ext/ were not used when initializing BertModel: ['cls.predictions.transform.dense.bias', 'cls.seq_relationship.bias',
'cls.predictions.decoder.weight', 'cls.predictions.transform.LayerNorm.weight', 'cls.predictions.transform.dense.weight', 'cls.seq_relationship.weight', 'cls.predictions.bias', 'cls.predi
ctions.transform.LayerNorm.bias']

  • This IS expected if you are initializing BertModel from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification
    model from a BertForPreTraining model).
  • This IS NOT expected if you are initializing BertModel from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a
    BertForSequenceClassification model).
    C:\SoftCXY\Anaconda\envs\torch3.8\lib\site-packages\torch\nn\modules\rnn.py:62: UserWarning: dropout option adds dropout after all but last recurrent layer, so non-zero dropout expects nu
    m_layers greater than 1, but got dropout=0.1 and num_layers=1
    warnings.warn("dropout option adds dropout after all but last "
    D:\KG\torchenv\lib\site-packages\transformers\optimization.py:391: FutureWarning: This implementation of AdamW is deprecated and will be removed in a future version. Use the PyTorch imple
    mentation torch.optim.AdamW instead, or set no_deprecation_warning=True to disable this warning
    warnings.warn(
    main.py:52: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.t
    ensor(sourceTensor).
    labels = torch.tensor(labels, dtype=torch.long)
    Could not load symbol cublasGetSmCountTarget from cublas64_11.dll. Error code 127
@taishan1994
Copy link
Owner

模型是否下载了放在指定的文件夹里。

@Amberpollar
Copy link
Author

1715747033626

@Amberpollar
Copy link
Author

大佬说的是这个模型吗?我照着目录结构放了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants