MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / init_weights

Method init_weights

eval_code/recons/models/moge/model/v1.py:244–247  ·  view source on GitHub ↗

Load the backbone with pretrained dinov2 weights from torch hub

(self)

Source from the content-addressed store, hash-verified

242 return model
243
244 def init_weights(self):
245 "Load the backbone with pretrained dinov2 weights from torch hub"
246 state_dict = torch.hub.load('facebookresearch/dinov2', self.encoder, pretrained=True).state_dict()
247 self.backbone.load_state_dict(state_dict)
248
249 def enable_gradient_checkpointing(self):
250 for i in range(len(self.backbone.blocks)):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected