【发布时间】:2022-06-16 15:17:42
【问题描述】:
每当我们为 TrainingArguments 创建对象时
from transformers import Trainer, TrainingArguments
batch_size = 64
logging_steps = len(emotions_encoded["train"]) // batch_size
model_name = f"{model_ckpt}-finetuned-emotion"
training_args = TrainingArguments(output_dir=model_name,
num_train_epochs=2,
learning_rate=2e-5,
per_device_train_batch_size=batch_size,
per_device_eval_batch_size=batch_size,
weight_decay=0.01,
evaluation_strategy="epoch",
disable_tqdm=False,
logging_steps=logging_steps,
push_to_hub=True,
log_level="error")
我得到了
AttributeError: 模块 'torch.distributed' 没有属性 'is_initialized'
【问题讨论】:
标签: python pytorch huggingface-transformers