Skip to content

Conversation

@ArneBinder
Copy link
Owner

@ArneBinder ArneBinder commented Sep 30, 2025

From pytorch-lightning 2.2 onwards, the models are not automatically set to train mode during training (see section "Improved Handling of Evaluation Mode" in the release notes). this affects e.g. loaded Huggingface transformer models.

With this PR, we explicitly set the model into training mode via model.train() before the actual training starts.

To just partly train the model (e.g. only some layers), the user is advised to override the train() method in their model.

@ArneBinder ArneBinder self-assigned this Sep 30, 2025
@ArneBinder ArneBinder added the bug Something isn't working label Sep 30, 2025
@ArneBinder ArneBinder marked this pull request as ready for review September 30, 2025 12:55
@ArneBinder ArneBinder merged commit b2aec47 into main Sep 30, 2025
3 of 4 checks passed
@ArneBinder ArneBinder deleted the set_model_to_train branch September 30, 2025 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants