> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wandb.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# W&B は `multiprocessing` ライブラリを使用しますか？

はい、W\&B は `multiprocessing` ライブラリを使用します。そのため、W\&B を直接呼び出すスクリプトでは、子プロセスがトップレベルのコードを再実行しないように、エントリポイントを保護する必要があります。次のエラーメッセージは、この問題を示しています：

```
An attempt has been made to start a new process before the current process 
has finished its bootstrapping phase.
```

これを解決するには、`if __name__ == "__main__":` を追加してエントリポイントを保護します。これは、スクリプトから直接 W\&B を実行する場合に必要です。これにより、`multiprocessing` によって生成されたワーカープロセスがトレーニングコードを再実行するのを防げます。

***

<Badge stroke shape="pill" color="orange" size="md">[Experiments](/ja/support/models/tags/experiments)</Badge>
