transformers
f348d3dc - fix(mask2former): register input_projections as nn.ModuleList (fixes #49698) (#49703)

Commit
28 days ago
fix(mask2former): register input_projections as nn.ModuleList (fixes #49698) (#49703) fix(mask2former): register input_projections as nn.ModuleList Mask2FormerTransformerModule kept input_projections in a plain Python list, so the input projection layers were never registered as PyTorch submodules: their parameters were excluded from model.parameters(), optimizers and the state dict, and model.to(device) left them on CPU causing 'input type ... and weight type ... should be the same' RuntimeErrors on CUDA. The pixel decoder already uses nn.ModuleList for the same structure (line 1266-1276) and the original Mask2Former implementation registers them the same way. Fixes #49698
Author
Parents
Loading