Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error logs to the training loop #142

Closed
wants to merge 3 commits into from

Conversation

sweep-nightly[bot]
Copy link

@sweep-nightly sweep-nightly bot commented Oct 29, 2023

Description

This PR adds error logs to the training loop in the src/main.py file. Error logging is important for identifying and debugging any issues that may occur during the training process. The Python logging module is used to handle the logging functionality.

Summary of Changes

  • Imported the logging module at the beginning of the src/main.py file.
  • Configured the logging module to write logs to a file, set the log level to ERROR, and format the logs to include the time of logging, the log level name, and the log message.
  • Added a try-except block around the model training code in the training loop.
  • In the except block, logged any exceptions that occur during training using logging.exception().

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

@sweep-nightly
Copy link
Author

sweep-nightly bot commented Oct 29, 2023

Sandbox Executions

  • Check src/main.py
Sandbox logs for
pip install -r requirements.txt 1/1 ❌ (`1`)
Looking in links: https://download.pytorch.org/whl/torch_stable.html
DEPRECATION: The HTML index page being used (https://download.pytorch.org/whl/torch_stable.html) is not a proper HTML 5 document. This is in violation of PEP 503 which requires these pages to be well-formed HTML 5 documents. Please reach out to the owners of this index page, and ask them to update this index page to a valid HTML 5 document. pip 22.2 will enforce this behaviour change. Discussion can be found at https://github.com/pypa/pip/issues/10825
Collecting annotated-types==0.6.0
  Downloading annotated_types-0.6.0-py3-none-any.whl (12 kB)
Collecting anyio==3.7.1
  Downloading anyio-3.7.1-py3-none-any.whl (80 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 80.9/80.9 KB 2.3 MB/s eta 0:00:00
Collecting astroid==3.0.1
  Downloading astroid-3.0.1-py3-none-any.whl (275 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 275.2/275.2 KB 15.1 MB/s eta 0:00:00
Collecting certifi==2022.12.7
  Downloading certifi-2022.12.7-py3-none-any.whl (155 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.3/155.3 KB 27.8 MB/s eta 0:00:00
Collecting charset-normalizer==2.1.1
  Downloading charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
Requirement already satisfied: click==8.1.7 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 7)) (8.1.7)
Collecting dill==0.3.
  Downloading dill-0.3.0.tar.gz (151 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 151.4/151.4 KB 25.5 MB/s eta 0:00:00
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
ERROR: Could not find a version that satisfies the requirement distutils (from versions: none)
ERROR: No matching distribution found for distutils
  • Check requirements.txt
Sandbox logs for
pip install -r requirements.txt 1/1 ❌ (`1`)
Looking in links: https://download.pytorch.org/whl/torch_stable.html
DEPRECATION: The HTML index page being used (https://download.pytorch.org/whl/torch_stable.html) is not a proper HTML 5 document. This is in violation of PEP 503 which requires these pages to be well-formed HTML 5 documents. Please reach out to the owners of this index page, and ask them to update this index page to a valid HTML 5 document. pip 22.2 will enforce this behaviour change. Discussion can be found at https://github.com/pypa/pip/issues/10825
Collecting annotated-types==0.6.0
  Downloading annotated_types-0.6.0-py3-none-any.whl (12 kB)
Collecting anyio==3.7.1
  Downloading anyio-3.7.1-py3-none-any.whl (80 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 80.9/80.9 KB 2.2 MB/s eta 0:00:00
Collecting astroid==3.0.1
  Downloading astroid-3.0.1-py3-none-any.whl (275 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 275.2/275.2 KB 14.6 MB/s eta 0:00:00
Collecting certifi==2022.12.7
  Downloading certifi-2022.12.7-py3-none-any.whl (155 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.3/155.3 KB 27.9 MB/s eta 0:00:00
Collecting charset-normalizer==2.1.1
  Downloading charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
Requirement already satisfied: click==8.1.7 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 7)) (8.1.7)
Collecting dill==0.3.
  Downloading dill-0.3.0.tar.gz (151 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 151.4/151.4 KB 20.0 MB/s eta 0:00:00
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
ERROR: Could not find a version that satisfies the requirement distutils (from versions: none)
ERROR: No matching distribution found for distutils
  • Check src/main.py
Sandbox logs for
pip install -r requirements.txt 1/1 ❌ (`1`)
Looking in links: https://download.pytorch.org/whl/torch_stable.html
DEPRECATION: The HTML index page being used (https://download.pytorch.org/whl/torch_stable.html) is not a proper HTML 5 document. This is in violation of PEP 503 which requires these pages to be well-formed HTML 5 documents. Please reach out to the owners of this index page, and ask them to update this index page to a valid HTML 5 document. pip 22.2 will enforce this behaviour change. Discussion can be found at https://github.com/pypa/pip/issues/10825
Collecting annotated-types==0.6.0
  Downloading annotated_types-0.6.0-py3-none-any.whl (12 kB)
Collecting anyio==3.7.1
  Downloading anyio-3.7.1-py3-none-any.whl (80 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 80.9/80.9 KB 2.3 MB/s eta 0:00:00
Collecting astroid==3.0.1
  Downloading astroid-3.0.1-py3-none-any.whl (275 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 275.2/275.2 KB 15.1 MB/s eta 0:00:00
Collecting certifi==2022.12.7
  Downloading certifi-2022.12.7-py3-none-any.whl (155 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.3/155.3 KB 27.8 MB/s eta 0:00:00
Collecting charset-normalizer==2.1.1
  Downloading charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
Requirement already satisfied: click==8.1.7 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 7)) (8.1.7)
Collecting dill==0.3.
  Downloading dill-0.3.0.tar.gz (151 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 151.4/151.4 KB 25.5 MB/s eta 0:00:00
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
ERROR: Could not find a version that satisfies the requirement distutils (from versions: none)
ERROR: No matching distribution found for distutils

@sweep-nightly
Copy link
Author

sweep-nightly bot commented Oct 29, 2023

Apply Sweep Rules to your PR?

  • Apply: All docstrings and comments should be up to date.
  • Apply: Code should be properly formatted and indented.
  • Apply: Variable and function names should be descriptive and follow a consistent naming convention.
  • Apply: Imports should be organized and grouped together.
  • Apply: There should be no unused imports or variables.
  • Apply: Code should be properly commented and include docstrings for functions and classes.

@sweep-nightly sweep-nightly bot closed this Nov 2, 2023
@sweep-nightly sweep-nightly bot deleted the sweep/add-error-logs_11 branch November 2, 2023 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sweep: add error logs to the training loop
0 participants