{"record":{"id":"4601f3c207f722f3","repo":"tensorflow/models","slug":"block-fn-is-not-supported-4601f3","errorCode":null,"errorMessage":"Block fn `{}` is not supported.","messagePattern":"Block fn `(.+?)` is not supported\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/modeling/backbones/resnet_deeplab.py","lineNumber":250,"sourceCode":"      x = self._norm(\n          axis=bn_axis,\n          momentum=norm_momentum,\n          epsilon=norm_epsilon,\n          synchronized=use_sync_bn)(\n              x)\n      x = tf_utils.get_activation(activation, use_keras_layer=True)(x)\n    else:\n      x = layers.MaxPool2D(pool_size=3, strides=2, padding='same')(x)\n\n    normal_resnet_stage = int(math.log2(self._output_stride)) - 2\n\n    endpoints = {}\n    for i in range(normal_resnet_stage + 1):\n      spec = RESNET_SPECS[model_id][i]\n      if spec[0] == 'bottleneck':\n        block_fn = nn_blocks.BottleneckBlock\n      else:\n        raise ValueError('Block fn `{}` is not supported.'.format(spec[0]))\n      x = self._block_group(\n          inputs=x,\n          filters=spec[1],\n          strides=(1 if i == 0 else 2),\n          dilation_rate=1,\n          block_fn=block_fn,\n          block_repeats=spec[2],\n          stochastic_depth_drop_rate=nn_layers.get_stochastic_depth_rate(\n              self._init_stochastic_depth_rate, i + 2, 4 + last_stage_repeats),\n          name='block_group_l{}'.format(i + 2))\n      endpoints[str(i + 2)] = x\n\n    dilation_rate = 2\n    for i in range(normal_resnet_stage + 1, 3 + last_stage_repeats):\n      spec = RESNET_SPECS[model_id][i] if i < 3 else RESNET_SPECS[model_id][-1]\n      if spec[0] == 'bottleneck':\n        block_fn = nn_blocks.BottleneckBlock\n      else:","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/modeling/backbones/resnet_deeplab.py#L232-L268","documentation":"Error \"Block fn `{}` is not supported.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/modeling/backbones/resnet_deeplab.py:250 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a supported block_fn: 'bottleneck' or 'basic'.","Check the block_fn value in the backbone config for typos."],"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"}