Unable to run example, returns error message

When I run this simple example, it always returns the error message.

from ray import tune
import ray

# 1. Define an objective function.
def objective(config):
    score = config["a"] ** 2 + config["b"]
    return {"score": score}


# 2. Define a search space.
search_space = {
    "a": tune.grid_search([0.001, 0.01, 0.1, 1.0]),
    "b": tune.choice([1, 2, 3]),
}

# 3. Start a Tune run and print the best result.

tuner = tune.Tuner(objective, param_space=search_space)
results = tuner.fit()
print(results.get_best_result(metric="score", mode="min").config)

Returned error message:

Exception: The current node has not been updated within 30 seconds, this could happen because of some of the Ray processes failed to startup.

What should I do to use ray?

Hi @dadi_xuanyuan,

Are you running this example locally?

What’s your Ray cluster setup? What’s your OS?

Hi justinvyu ,
My OS is windows,AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx 2.10 GHz and yes, I ran this example locally, using spyder. I am not familiar with ray tune, just ran the installer: pip install -U “ray[tune]” and ran the above example. I don’t know how to set up ray cluster, is there any easy setup example or tips?

Can you try starting a local ray cluster via the command line, then running your script with ray.init() at the top?

This may be related to [Bug] Exception: The current node has not been updated within 30 seconds, this could happen because of some of the Ray processes failed to startup. · Issue #19834 · ray-project/ray · GitHub, but it seems like a solution was not found. If you could create a new issue with a clear description of the hardware/software stack, that’d be great:

  1. Python version
  2. Conda?
  3. Ray version
  4. Hardware (GPUs?)

How are you running this on Spyder? What does that do compared to a regular python environment?

@dadi_xuanyuan any progress on running this locally as @justinvyu suggested?