{"record":{"id":"fe6102741b0a9269","repo":"tensorflow/models","slug":"only-allowed-output-stride-values-are-8-16-32","errorCode":null,"errorMessage":"Only allowed output_stride values are 8, 16, 32.","messagePattern":"Only allowed output_stride values are 8, 16, 32\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/modeling/backbones/mobilenet.py","lineNumber":1299,"sourceCode":"      use_sync_bn: If True, use synchronized batch normalization.\n      finegrain_classification_mode: If True, the model will keep the last layer\n        large even for small multipliers, following\n        https://arxiv.org/abs/1801.04381.\n      output_intermediate_endpoints: A `bool` of whether or not output the\n        intermediate endpoints.\n      **kwargs: Additional keyword arguments to be passed.\n    \"\"\"\n    if model_id not in SUPPORTED_SPECS_MAP:\n      raise ValueError('The MobileNet version {} '\n                       'is not supported'.format(model_id))\n\n    if filter_size_scale <= 0:\n      raise ValueError('filter_size_scale is not greater than zero.')\n\n    if output_stride is not None:\n      if model_id == 'MobileNetV1':\n        if output_stride not in [8, 16, 32]:\n          raise ValueError('Only allowed output_stride values are 8, 16, 32.')\n      else:\n        if output_stride == 0 or (output_stride > 1 and output_stride % 2):\n          raise ValueError('Output stride must be None, 1 or a multiple of 2.')\n\n    self._model_id = model_id\n    self._input_specs = input_specs\n    self._filter_size_scale = filter_size_scale\n    self._min_depth = min_depth\n    self._output_stride = output_stride\n    self._divisible_by = divisible_by\n    self._stochastic_depth_drop_rate = stochastic_depth_drop_rate\n    self._flat_stochastic_depth_drop_rate = flat_stochastic_depth_drop_rate\n    self._regularize_depthwise = regularize_depthwise\n    self._kernel_initializer = kernel_initializer\n    self._kernel_regularizer = kernel_regularizer\n    self._bias_regularizer = bias_regularizer\n    self._use_sync_bn = use_sync_bn\n    self._norm_momentum = norm_momentum","sourceCodeStart":1281,"sourceCodeEnd":1317,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/modeling/backbones/mobilenet.py#L1281-L1317","documentation":"Error \"Only allowed output_stride values are 8, 16, 32.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/modeling/backbones/mobilenet.py:1299 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set output_stride to one of the allowed values 8, 16, or 32.","Remove output_stride from the config to use the default."],"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"}