mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-23 17:56:07 +00:00
fix dinov3
This commit is contained in:
@@ -377,9 +377,7 @@ class RLearNPolicy(PreTrainedPolicy):
|
|||||||
inputs = {k: v.to(device) for k, v in inputs.items()}
|
inputs = {k: v.to(device) for k, v in inputs.items()}
|
||||||
|
|
||||||
# Process in batch through DINOv3 model
|
# Process in batch through DINOv3 model
|
||||||
# Use inference mode for stable, fast frozen encoder forward
|
vision_outputs = self.vision_model(**inputs)
|
||||||
with torch.inference_mode():
|
|
||||||
vision_outputs = self.vision_model(**inputs)
|
|
||||||
|
|
||||||
# Prefer mean-pooled patch tokens over pooler/CLS to ensure input-dependent variation
|
# Prefer mean-pooled patch tokens over pooler/CLS to ensure input-dependent variation
|
||||||
if hasattr(vision_outputs, 'last_hidden_state') and vision_outputs.last_hidden_state is not None:
|
if hasattr(vision_outputs, 'last_hidden_state') and vision_outputs.last_hidden_state is not None:
|
||||||
|
|||||||
Reference in New Issue
Block a user