MCPcopy Create free account
hub / github.com/PeizeSun/SparseR-CNN / freeze

Method freeze

detectron2/layers/blocks.py:43–55  ·  view source on GitHub ↗

Make this block not trainable. This method sets all parameters to `requires_grad=False`, and convert all BatchNorm layers to FrozenBatchNorm Returns: the block itself

(self)

Source from the content-addressed store, hash-verified

41 self.stride = stride
42
43 def freeze(self):
44 """
45 Make this block not trainable.
46 This method sets all parameters to `requires_grad=False`,
47 and convert all BatchNorm layers to FrozenBatchNorm
48
49 Returns:
50 the block itself
51 """
52 for p in self.parameters():
53 p.requires_grad = False
54 FrozenBatchNorm2d.convert_frozen_batchnorm(self)
55 return self
56
57
58class DepthwiseSeparableConv2d(nn.Module):

Callers 11

setupFunction · 0.45
setupFunction · 0.45
setupFunction · 0.45
setupFunction · 0.45
setupFunction · 0.45
setup_cfgFunction · 0.45
auto_scale_workersMethod · 0.45
add_export_configFunction · 0.45
setupFunction · 0.45
setup_cfgFunction · 0.45
setup_cfgFunction · 0.45

Calls 1

Tested by

no test coverage detected