keras-team/keras · error · ValueError
The provided job_addresses
Error message
The provided job_addresses {job_addresses} has {len(job_addresses)} jobs, but num_processes is {num_processes} What it means
Raised by the JAX distribution initialize() when a comma-separated job_addresses list contains a different number of entries than num_processes. Multi-host setup treats the first address as coordinator and expects exactly one address per process, so the counts must match.
Solutions
- Provide exactly num_processes addresses, e.g. 'host1:port,host2:port' for num_processes=2.
- Set num_processes to match the number of addresses given.
- Or pass a single coordinator address (no comma) and let the cluster runtime resolve peers.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at keras/src/backend/jax/distribution_lib.py:146 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of keras-team/keras@7a34a03db6 (2026-08-25).
Data as JSON: /api/errors/9be37d25c43b370b.
Report an issue: GitHub.
Appendix: source
Thrown at keras/src/backend/jax/distribution_lib.py:146
# Sum across processes and pull out the first item.
global_seed = jax.pmap(
lambda x: jax.lax.psum(x, "all"),
axis_name="all",
devices=cpu_devices,
)(local_seed).item(0)
# Set the global seed.
rng_utils.set_random_seed(global_seed)
def initialize(job_addresses, num_processes, process_id):
if job_addresses and "," in job_addresses:
# When user provide all the job addresses, we will split and get the
# first one, which is the coordinator.
job_addresses = job_addresses.split(",")
# Do a sanity check to make sure the number of addresses also match
# the num_processes.
if num_processes is not None and num_processes != len(job_addresses):
raise ValueError(
f"The provided job_addresses {job_addresses} has "
f"{len(job_addresses)} jobs, but num_processes is "
f"{num_processes}"
)
coordinator_address = job_addresses[0]
else:
coordinator_address = job_addresses
jax.distributed.initialize(
coordinator_address=coordinator_address,
num_processes=num_processes,
process_id=process_id,
)
# Ensure the random number generator is initialized across processes.
initialize_rng()
View on GitHub (pinned to 7a34a03db6)