> ## 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.

# sweep 中に `anaconda 400 error` が発生した場合はどうすればよいですか

sweep 中に `anaconda 400 error` が発生する場合、多くは最適化対象のメトリクスをログしていないことを意味します。次のように表示されることがあります。

```text theme={null}
wandb: ERROR Error while calling W&B API: anaconda 400 error:
{"code": 400, "message": "TypeError: bad operand type for unary -: 'NoneType'"}
```

sweep コントローラーは、Runs を比較するために必要なメトリクスを見つけられません。sweep 設定で指定した正確なメトリクス名をログしてください。たとえば、sweep 設定で次のように指定している場合:

```yaml theme={null}
metric:
  name: validation_loss
  goal: minimize
```

トレーニングループに、対応する `wandb.log` 呼び出しを追加します:

```python theme={null}
# エポックまたはステップで validation_loss を計算した後:
# wandb.log({"validation_loss": value})
```

メトリクス名は、sweep の設定と `wandb.log` の呼び出しで完全に一致している必要があります。

詳細は、[Sweeps のトラブルシューティング](/ja/models/sweeps/troubleshoot-sweeps/) と [sweep の設定を定義する](/ja/models/sweeps/define-sweep-configuration/) を参照してください。

***

<Badge stroke shape="pill" color="orange" size="md">[Sweeps](/ja/support/models/tags/sweeps)</Badge><Badge stroke shape="pill" color="orange" size="md">[メトリクス](/ja/support/models/tags/metrics)</Badge>
