{"record":{"id":"dd6c60cc19cd33c1","repo":"tensorflow/models","slug":"task-not-found-s","errorCode":null,"errorMessage":"Task not found: %s","messagePattern":"Task not found: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/legacy/xlnet/preprocess_classification_data.py","lineNumber":400,"sourceCode":"    tf_example = tf.train.Example(features=tf.train.Features(feature=features))\n    writer.write(tf_example.SerializeToString())\n  writer.close()\n\n\ndef main(_):\n  logging.set_verbosity(logging.INFO)\n  processors = {\n      \"mnli_matched\": MnliMatchedProcessor,\n      \"mnli_mismatched\": MnliMismatchedProcessor,\n      \"sts-b\": StsbProcessor,\n      \"imdb\": ImdbProcessor,\n      \"yelp5\": Yelp5Processor\n  }\n\n  task_name = FLAGS.task_name.lower()\n\n  if task_name not in processors:\n    raise ValueError(\"Task not found: %s\" % (task_name))\n\n  processor = processors[task_name]()\n  label_list = processor.get_labels() if not FLAGS.is_regression else None\n\n  sp = spm.SentencePieceProcessor()\n  sp.Load(FLAGS.spiece_model_file)\n\n  def tokenize_fn(text):\n    text = preprocess_utils.preprocess_text(text, lower=FLAGS.uncased)\n    return preprocess_utils.encode_ids(sp, text)\n\n  spm_basename = os.path.basename(FLAGS.spiece_model_file)\n\n  train_file_base = \"{}.len-{}.train.tf_record\".format(spm_basename,\n                                                       FLAGS.max_seq_length)\n  train_file = os.path.join(FLAGS.output_dir, train_file_base)\n  logging.info(\"Use tfrecord file %s\", train_file)\n","sourceCodeStart":382,"sourceCodeEnd":418,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/legacy/xlnet/preprocess_classification_data.py#L382-L418","documentation":"Dispatch guard in preprocess_classification_data.main: the lowercased --task_name matched none of the registered processors (mnli_matched, mnli_mismatched, sts-b, imdb, yelp5). The task name flag is the faulty input.","triggerScenarios":"Thrown at official/legacy/xlnet/preprocess_classification_data.py:400 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use one of the supported task names, e.g. 'mnli_matched', 'sts-b', 'imdb', 'yelp5'","Register a custom Processor class in the processors dict for a new task"],"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"}