tensorflow/models · error · ValueError
sample_from_segments and sample_around_keyframes cannot be T
Error message
sample_from_segments and sample_around_keyframes cannot be True at the same time.
What it means
Error "sample_from_segments and sample_around_keyframes cannot be True at the same time." thrown in tensorflow/models.
Source
Thrown at official/projects/videoglue/datasets/common/utils.py:289
augmentation_params: A dictionary contains image augmentation parameters
associated with the augmentation style.
randaug_params: A dictionary of params for RandAug policy.
autoaug_params: A dictionary of params for AutoAug policy.
sync_random_state: Whether to use stateful option to keep random operations
in sync between different modalities. All modalities having this option
True will use the same outcome in random operations such as sampling and
cropping.
seed: the random seed.
"""
# Validate parameters.
if sync_random_state and multi_crop:
raise ValueError('multi_crop is not supported with sync random states.')
if augmentation_type.lower() == 'ava' and multi_crop:
raise ValueError('multi_crop should not be combined with ava augmentation.')
if sample_from_segments and sample_around_keyframe:
raise ValueError('sample_from_segments and sample_around_keyframes cannot '
'be True at the same time.')
if sample_from_segments and num_test_clips > 1:
raise ValueError(
'sample_from_segments is set to True while got num_test_clips: %d'
% num_test_clips
)
# Parse frames.
if isinstance(parser_builder, builders.SequenceExampleParserBuilder):
parser_builder.parse_feature(
feature_name=input_feature_name,
feature_type=tf.io.FixedLenSequenceFeature((), dtype=tf.string),
output_name=output_feature_name)
elif isinstance(parser_builder, builders.ExampleParserBuilder):
parser_builder.parse_feature(
feature_name=input_feature_name,
feature_type=tf.io.FixedLenFeature((), dtype=tf.string),View on GitHub (pinned to e006f5f0d5)
When it happens
Trigger: Thrown at official/projects/videoglue/datasets/common/utils.py:289 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/bfd38bcad2d78981.
Report an issue: GitHub.