tensorflow/models · error · ValueError

Unrecongized dtype: {dtype}

Error message

Unrecongized dtype: {dtype}

What it means

Error "Unrecongized dtype: {dtype}" thrown in tensorflow/models.

Source

Thrown at official/projects/movinet/tools/quantize_movinet.py:140

  image_string = tf.io.encode_png(
      tf.squeeze(tf.cast(input_frame * 255., tf.uint8), axis=[0, 1]))
  features['image'] = _bytes_feature(image_string.numpy())

  # Input/Output states at time T
  for k, v in output_states.items():
    dtype = v[0].dtype
    if dtype == tf.int32:
      features['input/' + k] = _int64_feature(
          input_states[k].numpy().flatten().tolist())
      features['output/' + k] = _int64_feature(
          output_states[k].numpy().flatten().tolist())
    elif dtype == tf.float32:
      features['input/' + k] = _float_feature(
          input_states[k].numpy().flatten().tolist())
      features['output/' + k] = _float_feature(
          output_states[k].numpy().flatten().tolist())
    else:
      raise ValueError(f'Unrecongized dtype: {dtype}')

  tfe = _build_tf_example(features)
  record_file = '{}/movinet_stream_{:06d}.tfrecords'.format(
      output_dataset_dir, file_index)
  logging.info('Saving to %s.', record_file)
  with tf.io.TFRecordWriter(record_file) as writer:
    writer.write(tfe)


def get_dataset() -> tf.data.Dataset:
  """Gets dataset source."""
  config = video_classification_configs.video_classification_kinetics600()

  temporal_stride = FLAGS.temporal_stride
  num_frames = FLAGS.num_frames
  image_size = FLAGS.image_size
  feature_shape = (num_frames, image_size, image_size, 3)

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: Thrown at official/projects/movinet/tools/quantize_movinet.py:140 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/297ca4c909000d8d. Report an issue: GitHub.