首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >当我在<< report_to = 'wandb‘>>中引入TrainingArguments时,模型停止了训练

当我在<< report_to = 'wandb‘>>中引入TrainingArguments时,模型停止了训练
EN

Stack Overflow用户
提问于 2022-01-04 02:59:29
回答 1查看 203关注 0票数 0

我正在下载模型https://huggingface.co/microsoft/Multilingual-MiniLM-L12-H384/tree/main微软/多语种-MiniLM-L12-H384,然后使用它。

变压器版本:4.11.3

我编写了以下代码:

代码语言:javascript
运行
复制
import wandb
wandb.login()
%env WANDB_LOG_MODEL=true

model = tr.BertForSequenceClassification.from_pretrained("/home/pc/minilm_model",num_labels=2)
model.to(device)

print("hello")

training_args = tr.TrainingArguments(
report_to = 'wandb',
output_dir='/home/pc/proj/results2', # output directory
num_train_epochs=10, # total number of training epochs
per_device_train_batch_size=16, # batch size per device during training
per_device_eval_batch_size=32, # batch size for evaluation
learning_rate=2e-5,
warmup_steps=1000, # number of warmup steps for learning rate scheduler
weight_decay=0.01, # strength of weight decay
logging_dir='./logs', # directory for storing logs
logging_steps=1000,
evaluation_strategy="epoch",
save_strategy="no"
)

print("hello")

trainer = tr.Trainer(
model=model, # the instantiated  Transformers model to be trained
args=training_args, # training arguments, defined above
train_dataset=train_data, # training dataset
eval_dataset=val_data, # evaluation dataset
compute_metrics=compute_metrics
)

在执行此操作之后:

这个模型就停留在这一点上:

*跑步训练*

代码语言:javascript
运行
复制
Num examples = 12981
 Num Epochs = 20
 Instantaneous batch size per device = 16
 Total train batch size (w. parallel, distributed & accumulation) = 32
 Gradient Accumulation steps = 1
 Total optimization steps = 8120
Automatic Weights & Biases logging enabled, to disable set os.environ["WANDB_DISABLED"] = "true"

,可能的解决方案是什么?

EN

回答 1

Stack Overflow用户

发布于 2022-01-04 12:12:34

我不知道为什么这会停止训练。

如果你发到HF论坛,也许有人可以帮你:https://discuss.huggingface.co

我为W&B工作,所以如果您认为这与使用W&B有关,或者您有任何问题,我可以在这里或在我们的论坛上帮助您。http://community.wandb.ai

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70573652

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档