{"record":{"id":"288fed2eadbe350a","repo":"tensorflow/models","slug":"tpu-training-does-not-support-data-producer-yet-u","errorCode":null,"errorMessage":"TPU training does not support data producer yet. Use pre-processed data.","messagePattern":"TPU training does not support data producer yet\\. Use pre-processed data\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/recommendation/ncf_input_pipeline.py","lineNumber":174,"sourceCode":"        params[\"batch_size\"],\n        is_training=True,\n        rebatch=False)\n\n    # Re-batch evaluation dataset for TPU Pods.\n    # TODO (b/162341937) remove once it's fixed.\n    eval_rebatch = (params[\"use_tpu\"] and strategy.num_replicas_in_sync > 8)  # pyrefly: ignore[missing-attribute]\n    eval_dataset = create_dataset_from_tf_record_files(\n        params[\"eval_dataset_path\"],\n        input_meta_data[\"eval_prebatch_size\"],  # pyrefly: ignore[unsupported-operation]\n        params[\"eval_batch_size\"],\n        is_training=False,\n        rebatch=eval_rebatch)\n\n    num_train_steps = int(input_meta_data[\"num_train_steps\"])  # pyrefly: ignore[unsupported-operation]\n    num_eval_steps = int(input_meta_data[\"num_eval_steps\"])  # pyrefly: ignore[unsupported-operation]\n  else:\n    if params[\"use_tpu\"]:\n      raise ValueError(\"TPU training does not support data producer yet. \"\n                       \"Use pre-processed data.\")\n\n    assert producer\n    # Start retrieving data from producer.\n    train_dataset, eval_dataset = create_dataset_from_data_producer(\n        producer, params)\n    num_train_steps = producer.train_batches_per_epoch\n    num_eval_steps = producer.eval_batches_per_epoch\n\n  return train_dataset, eval_dataset, num_train_steps, num_eval_steps\n","sourceCodeStart":156,"sourceCodeEnd":185,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/recommendation/ncf_input_pipeline.py#L156-L185","documentation":"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.","triggerScenarios":"Thrown at official/recommendation/ncf_input_pipeline.py:174 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}