{"record":{"id":"5c2ff8195e752c29","repo":"tensorflow/models","slug":"strides-1-requires-use-projections-true-otherwi","errorCode":null,"errorMessage":"strides > 1 requires use_projections=True, otherwise the inputs and shortcut will have shape mismatch","messagePattern":"strides > 1 requires use_projections=True, otherwise the inputs and shortcut will have shape mismatch","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"official/projects/assemblenet/modeling/assemblenet.py","lineNumber":266,"sourceCode":"    inter_filters: `int` number of filters for the second conv. layer.\n    strides: `int` block stride. If greater than 1, this block will ultimately\n      downsample the input spatially.\n    use_projection: `bool` for whether this block should use a projection\n      shortcut (versus the default identity shortcut). This is usually `True`\n      for the first block of a block group, which may change the number of\n      filters and the resolution.\n    num_frames: `int` number of frames in the input tensor.\n    temporal_dilation: `int` temporal dilatioin size for the 1D conv.\n    bn_decay: `float` batch norm decay parameter to use.\n    bn_epsilon: `float` batch norm epsilon parameter to use.\n    use_sync_bn: use synchronized batch norm for TPU.\n    step: `int` to decide whether to put 2D module or (2+1)D module.\n\n  Returns:\n    The output `Tensor` of the block.\n  \"\"\"\n  if strides > 1 and not use_projection:\n    raise ValueError('strides > 1 requires use_projections=True, otherwise the '\n                     'inputs and shortcut will have shape mismatch')\n  shortcut = inputs\n  if use_projection:\n    # Projection shortcut only in first block within a group. Bottleneck blocks\n    # end with 4 times the number of filters.\n    filters_out = 4 * filters\n    shortcut = conv2d_fixed_padding(\n        inputs=inputs, filters=filters_out, kernel_size=1, strides=strides)\n    shortcut = rf.build_batch_norm(\n        bn_decay=bn_decay, bn_epsilon=bn_epsilon, use_sync_bn=use_sync_bn)(\n            shortcut)\n\n  if step % 2 == 1:\n    k = 3\n\n    inputs = reshape_temporal_conv1d_bn(\n        inputs=inputs,\n        filters=filters,","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/assemblenet/modeling/assemblenet.py#L248-L284","documentation":"Error \"strides > 1 requires use_projections=True, otherwise the inputs and shortcut will have shape mismatch\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/assemblenet/modeling/assemblenet.py:266 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"}