{"record":{"id":"bfd38bcad2d78981","repo":"tensorflow/models","slug":"sample-from-segments-and-sample-around-keyframes-c","errorCode":null,"errorMessage":"sample_from_segments and sample_around_keyframes cannot be True at the same time.","messagePattern":"sample_from_segments and sample_around_keyframes cannot be True at the same time\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/videoglue/datasets/common/utils.py","lineNumber":289,"sourceCode":"    augmentation_params: A dictionary contains image augmentation parameters\n      associated with the augmentation style.\n    randaug_params: A dictionary of params for RandAug policy.\n    autoaug_params:  A dictionary of params for AutoAug policy.\n    sync_random_state: Whether to use stateful option to keep random operations\n      in sync between different modalities. All modalities having this option\n      True will use the same outcome in random operations such as sampling and\n      cropping.\n    seed: the random seed.\n  \"\"\"\n  # Validate parameters.\n  if sync_random_state and multi_crop:\n    raise ValueError('multi_crop is not supported with sync random states.')\n\n  if augmentation_type.lower() == 'ava' and multi_crop:\n    raise ValueError('multi_crop should not be combined with ava augmentation.')\n\n  if sample_from_segments and sample_around_keyframe:\n    raise ValueError('sample_from_segments and sample_around_keyframes cannot '\n                     'be True at the same time.')\n\n  if sample_from_segments and num_test_clips > 1:\n    raise ValueError(\n        'sample_from_segments is set to True while got num_test_clips: %d'\n        % num_test_clips\n    )\n\n  # Parse frames.\n  if isinstance(parser_builder, builders.SequenceExampleParserBuilder):\n    parser_builder.parse_feature(\n        feature_name=input_feature_name,\n        feature_type=tf.io.FixedLenSequenceFeature((), dtype=tf.string),\n        output_name=output_feature_name)\n  elif isinstance(parser_builder, builders.ExampleParserBuilder):\n    parser_builder.parse_feature(\n        feature_name=input_feature_name,\n        feature_type=tf.io.FixedLenFeature((), dtype=tf.string),","sourceCodeStart":271,"sourceCodeEnd":307,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/videoglue/datasets/common/utils.py#L271-L307","documentation":"Error \"sample_from_segments and sample_around_keyframes cannot be True at the same time.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/videoglue/datasets/common/utils.py:289 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}