This PR adds error logging functionality to the training loop in the PyTorch model. It ensures that any errors encountered during training are logged with the appropriate severity level, allowing for easier debugging and troubleshooting.
Summary of Changes
Imported the logging module to enable logging functionality.
Configured the logging module to log messages of level ERROR and above to both the console and a file named 'training_errors.log'.
Added try-except blocks in the training loop to catch and log any errors that occur during training.
Logged the error message and stack trace using the logging module, including the current epoch and batch number if available.
Please review and merge this PR to enhance the error handling and debugging capabilities of the training loop.
Fixes #1.
🎉 Latest improvements to Sweep:
Sweep can now passively improve your repository! Check out Rules to learn more.
💡 To get Sweep to edit this pull request, you can:
Comment below, and Sweep can edit the entire PR
Comment on a file, Sweep will only modify the commented file
Edit the original issue to get Sweep to recreate the PR from scratch
Description
This PR adds error logging functionality to the training loop in the PyTorch model. It ensures that any errors encountered during training are logged with the appropriate severity level, allowing for easier debugging and troubleshooting.
Summary of Changes
Please review and merge this PR to enhance the error handling and debugging capabilities of the training loop.
Fixes #1.
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can: