{"record":{"id":"297ca4c909000d8d","repo":"tensorflow/models","slug":"unrecongized-dtype-dtype","errorCode":null,"errorMessage":"Unrecongized dtype: {dtype}","messagePattern":"Unrecongized dtype: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/movinet/tools/quantize_movinet.py","lineNumber":140,"sourceCode":"  image_string = tf.io.encode_png(\n      tf.squeeze(tf.cast(input_frame * 255., tf.uint8), axis=[0, 1]))\n  features['image'] = _bytes_feature(image_string.numpy())\n\n  # Input/Output states at time T\n  for k, v in output_states.items():\n    dtype = v[0].dtype\n    if dtype == tf.int32:\n      features['input/' + k] = _int64_feature(\n          input_states[k].numpy().flatten().tolist())\n      features['output/' + k] = _int64_feature(\n          output_states[k].numpy().flatten().tolist())\n    elif dtype == tf.float32:\n      features['input/' + k] = _float_feature(\n          input_states[k].numpy().flatten().tolist())\n      features['output/' + k] = _float_feature(\n          output_states[k].numpy().flatten().tolist())\n    else:\n      raise ValueError(f'Unrecongized dtype: {dtype}')\n\n  tfe = _build_tf_example(features)\n  record_file = '{}/movinet_stream_{:06d}.tfrecords'.format(\n      output_dataset_dir, file_index)\n  logging.info('Saving to %s.', record_file)\n  with tf.io.TFRecordWriter(record_file) as writer:\n    writer.write(tfe)\n\n\ndef get_dataset() -> tf.data.Dataset:\n  \"\"\"Gets dataset source.\"\"\"\n  config = video_classification_configs.video_classification_kinetics600()\n\n  temporal_stride = FLAGS.temporal_stride\n  num_frames = FLAGS.num_frames\n  image_size = FLAGS.image_size\n  feature_shape = (num_frames, image_size, image_size, 3)\n","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/movinet/tools/quantize_movinet.py#L122-L158","documentation":"Raised in save_to_tfrecord when an output state tensor's dtype is neither tf.int32 nor tf.float32 while serializing MoViNet stateful RNN states to TFRecord features. Only int32 and float32 state tensors have supported converter paths; any other dtype (e.g. bfloat16, float64, bool) fires this error.","triggerScenarios":"Thrown at official/projects/movinet/tools/quantize_movinet.py:140 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect output_states to find which key has a non-int32/float32 dtype","Cast the offending state tensor to tf.float32 before serialization","Extend the branch chain with a case for the actual dtype"],"exampleFix":null,"handlingStrategy":"fallback","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"}