Skip to content

Clarify documentation/defaults for trainable_backbone_layers #4905

@ethanwhite

Description

@ethanwhite

📚 The doc issue

The defaults for trainable_backbone_layers are currently set to None (used in faster_rcnn, keypoint_rcnn, mask_rcnn, and retinanet) and the description in Args: is a version of:

trainable_backbone_layers (int): number of trainable (not frozen) resnet layers starting from final block.
   Valid values are between 0 and 5, with 5 meaning all backbone layers are trainable.

This makes it unclear what value is used in the default case. One reasonable reading of this is that none of the backbone layers are trained. The actual value used if this optional argument isn't change is 3, which is set by _validate_trainable_layers, and can only be determined by reading the source.

Suggest a potential alternative/fix

Either the defaults should be changed to 3 to clearly indicate the default behavior or the docstrings in faster_rcnn, keypoint_rcnn, mask_rcnn, and retinanet should be updated to something like:

trainable_backbone_layers (int): number of trainable (not frozen) resnet layers starting from final block.
   Valid values are between 0 and 5, with 5 meaning all backbone layers are trainable. 3 is used if this argument is not set.

I'd be happy to submit a PR with either of these approaches, but wanted to check if this is useful and which approach is preferred before proceeding.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions