tensorflow/models · error · ValueError
TPU training does not support data producer yet. Use…
Error message
TPU training does not support data producer yet. Use pre-processed data.
What it means
Raised in create_ncf_input_data when TPU training is requested but no pre-processed TFRecord data is supplied; the runtime data producer is not supported on TPU.
Solutions
- Run preprocessing first and point params['train_dataset_path']/['eval_dataset_path'] at the generated TFRecords
- Set use_tpu=False if you must generate data online (GPU/CPU training)
- Follow the TPU instructions in the NCF README to produce and stage the data files
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at official/recommendation/ncf_input_pipeline.py:174 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of tensorflow/models@e006f5f0d5 (2026-08-24).
Data as JSON: /api/errors/288fed2eadbe350a.
Report an issue: GitHub.
Appendix: source
Thrown at official/recommendation/ncf_input_pipeline.py:174
params["batch_size"],
is_training=True,
rebatch=False)
# Re-batch evaluation dataset for TPU Pods.
# TODO (b/162341937) remove once it's fixed.
eval_rebatch = (params["use_tpu"] and strategy.num_replicas_in_sync > 8) # pyrefly: ignore[missing-attribute]
eval_dataset = create_dataset_from_tf_record_files(
params["eval_dataset_path"],
input_meta_data["eval_prebatch_size"], # pyrefly: ignore[unsupported-operation]
params["eval_batch_size"],
is_training=False,
rebatch=eval_rebatch)
num_train_steps = int(input_meta_data["num_train_steps"]) # pyrefly: ignore[unsupported-operation]
num_eval_steps = int(input_meta_data["num_eval_steps"]) # pyrefly: ignore[unsupported-operation]
else:
if params["use_tpu"]:
raise ValueError("TPU training does not support data producer yet. "
"Use pre-processed data.")
assert producer
# Start retrieving data from producer.
train_dataset, eval_dataset = create_dataset_from_data_producer(
producer, params)
num_train_steps = producer.train_batches_per_epoch
num_eval_steps = producer.eval_batches_per_epoch
return train_dataset, eval_dataset, num_train_steps, num_eval_steps
View on GitHub (pinned to e006f5f0d5)