MCPcopy Index your code
hub / github.com/ActiveVisionLab/DFNet / disable_model_grad

Function disable_model_grad

script/feature/direct_feature_matching.py:52–61  ·  view source on GitHub ↗

set whole model to requires_grad=False, this is for nerf model

(model)

Source from the content-addressed store, hash-verified

50 return feature
51
52def disable_model_grad(model):
53 ''' set whole model to requires_grad=False, this is for nerf model '''
54 # print("disable_model_grad...")
55 for module in model.modules():
56 # print("this is a layer:", module)
57 if hasattr(module, 'weight'):
58 module.weight.requires_grad_(False)
59 if hasattr(module, 'bias'):
60 module.bias.requires_grad_(False)
61 return model
62
63def inference_pose_regression(args, data, device, model, retFeature=False, isSingleStream=True, return_pose=True):
64 """

Callers 1

train_feature_matchingFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected