tensorflow/models · error · ValueError
Only support square crop. Got feature shape: %s
Error message
Only support square crop. Got feature shape: %s
What it means
Error "Only support square crop. Got feature shape: %s" thrown in tensorflow/models.
Source
Thrown at official/projects/videoglue/datasets/dataset_factory.py:64
def __init__(self, params: cfg.DataConfig, dataset_config: Mapping[str, Any]):
"""Constructor.
Args:
params: Instance of `Dataset` configuration,
dataset_config: The config dictionary used for data reader pipeline.
"""
self._params = params
self._dataset_config = dataset_config
self._name = params.name
self._is_training = params.is_training
self._shuffle = params.is_training
dataset_cls = FACTORY[self._name]
self._dataset_cls = dataset_cls(
subset='train' if self._is_training else 'test')
if params.feature_shape[1] != params.feature_shape[2]:
raise ValueError('Only support square crop. Got feature shape: %s' %
params.feature_shape)
self._dataset_cls.configure(**dataset_config)
self._dataset_cls.tune(
prefetch_buffer_size=params.prefetch_buffer_size,
shuffle_buffer=params.shuffle_buffer_size,
num_process_threads=params.num_process_threads,
cycle_length=params.cycle_length,
num_parallel_calls_interleave=params.num_parallel_calls_interleave,
block_length=params.block_length)
def _dataset_fn(
self,
input_context: Optional[tf.distribute.InputContext] = None
) -> tf.data.Dataset:
"""Generates features and labels for training or evaluation.
This uses the input pipeline based approach using file name queue to readView on GitHub (pinned to e006f5f0d5)
When it happens
Trigger: Thrown at official/projects/videoglue/datasets/dataset_factory.py:64 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/3efd20d95b85c876.
Report an issue: GitHub.