Skip to main content
The following error usually occurs when you do not log the metric that you are optimizing:
wandb: ERROR Error while calling W&B API: anaconda 400 error:
{"code": 400, "message": "TypeError: bad operand type for unary -: 'NoneType'"}
To fix this, make sure you are logging the exact metric specified in your sweep configuration. For example, if your sweep config specifies:
metric:
  name: validation_loss
  goal: minimize
Then your training code must call:
wandb.log({"validation_loss": value})
The metric name must match exactly between your sweep configuration and your wandb.log call. For more information, see Sweeps troubleshooting and Define sweep configuration.
Sweeps Metrics