# Chapter 7 questions

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fchapter-7-questions%2F11746%3E%5C
**Category:** Course\
**Created:** [November 15, 2021, 2:13pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fchapter-7-questions%2F11746 "2021-11-15T14:13:26Z")\
**Posts on this page:** 1\
**Showing post:** 119

<div class="post-metadata">

**Author:** ![thomaspurk](https://avatars.discourse-cdn.com/v4/letter/t/f1d935/32.png) [@thomaspurk](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fthomaspurk)%5C
**Post date:** [January 17, 2025, 8:37pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fchapter-7-questions%2F11746%2F119 "2025-01-17T20:37:33Z")

</div>

Getting an error:

```auto
Error: You must call wandb.init() before wandb.log()

```

“Main NLP Tasks” in section “Fine tuning a Masked Language Model” at the following line

```py
trainer.train()

```

The solution is to update the training arguments defined a few lines above.

```py
training_args = TrainingArguments(
    output_dir=f"{model_name}-finetuned-imdb",
    overwrite_output_dir=True,
    evaluation_strategy="epoch",
    learning_rate=2e-5,
    weight_decay=0.01,
    per_device_train_batch_size=batch_size,
    per_device_eval_batch_size=batch_size,
    push_to_hub=True,
    fp16=True,
    logging_steps=logging_steps,
    report_to="none" # ADD THIS LINE!
)

```

This is covered in another thread but an initial non-working answer is given, with another poster correcting None to “none” in a response. Also, other alternative solutions are offered that could be tried.

> [@How to turn WanDB off in trainer?](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-turn-wandb-off-in-trainer%2F6237%2F2%23%3A~%3Atext%3Dlewtun-%2CMay%25202021%2C-alternatively%252C%2520you%2520can)%3A
>
> import os os.environ[“WANDB\_DISABLED”] = “true” This works for me.

---

_[View the full topic](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fchapter-7-questions%2F11746)._
