Skip to content

Fixed incorrect log position. (#1098)#1099

Merged
vfdev-5 merged 4 commits intopytorch:masterfrom
Yevgnen:master
Jun 4, 2020
Merged

Fixed incorrect log position. (#1098)#1099
vfdev-5 merged 4 commits intopytorch:masterfrom
Yevgnen:master

Conversation

@Yevgnen
Copy link
Copy Markdown
Contributor

@Yevgnen Yevgnen commented Jun 3, 2020

Fixes #1098

Description:

Fire all events before logging time usages to prevent incorrect log position.

Check list:

  • New tests are added (if a new feature is added)
  • New doc strings: description and/or example code are in RST format
  • Documentation is updated (if required)

self._fire_event(Events.TERMINATE)
break
self._fire_event(Events.EPOCH_COMPLETED)
self.logger.info("Epoch[%s] Complete. Time taken: %02d:%02d:%02d", self.state.epoch, hours, mins, secs)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, we also need to call it after self._fire_event(Events.TERMINATE) with message "Epoch[%s] Terminated. ..."

@vfdev-5
Copy link
Copy Markdown
Collaborator

vfdev-5 commented Jun 3, 2020

@Yevgnen thanks a lot for the PR !
I think we need to readjust some tests...

@vfdev-5 vfdev-5 changed the title Fixed incorrect log poistion. (#1098) Fixed incorrect log position. (#1098) Jun 3, 2020
@Yevgnen
Copy link
Copy Markdown
Contributor Author

Yevgnen commented Jun 3, 2020

@vfdev-5 Following the contributing guide, I try to re-run the tests, but got

tests/run_cpu_tests.sh: line 5: CI_PYTHON_VERSION: unbound variable

@vfdev-5
Copy link
Copy Markdown
Collaborator

vfdev-5 commented Jun 3, 2020

Yes, this should be a forgotten to mention :) Thanks for pointing out !
Please, just set it as export CI_PYTHON_VERSION=<your python version, e.g 3.7>. Otherwise, you can simply run the failing test as :

pytest tests/ignite/test_utils.py::test_setup_logger -vvv

Copy link
Copy Markdown
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @Yevgnen !

@vfdev-5 vfdev-5 merged commit 7bd8ce1 into pytorch:master Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect log position

2 participants