tensorflow/models · error · ValueError

Unrecognized file_type: {}

Error message

Unrecognized file_type: {}

What it means

Error "Unrecognized file_type: {}" thrown in tensorflow/models.

Source

Thrown at official/common/dataset_fn.py:44

# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Utility library for picking an appropriate dataset function."""

import functools
from typing import Any, Callable, Type, Union

import tensorflow as tf, tf_keras

PossibleDatasetType = Union[Type[tf.data.Dataset], Callable[[tf.Tensor], Any]]


def pick_dataset_fn(file_type: str) -> PossibleDatasetType:
  if file_type == 'tfrecord':
    return tf.data.TFRecordDataset
  if file_type == 'tfrecord_compressed':
    return functools.partial(tf.data.TFRecordDataset, compression_type='GZIP')
  raise ValueError('Unrecognized file_type: {}'.format(file_type))

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: Thrown at official/common/dataset_fn.py:44 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/60ac4fc2fe9b4bdf. Report an issue: GitHub.