We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Engine.run(data=None, ...)
Reported in this issue: #3189 (comment)
Repro code:
from ignite.engine import Engine, Events max_epochs = 4 dataset = range(10) def training_step(engine, _): print(f"- {engine.state.epoch} / {engine.state.max_epochs} | {engine.state.iteration}") print(f"- batch: {next(engine.state.dataiter)}") print('-'*120) trainer = Engine(training_step) trainer.state.dataiter = iter(dataset) @trainer.on(Events.DATALOADER_STOP_ITERATION) def init_data_iter(): print('THIS SHOULD NOT BE CALLED') trainer.state.dataiter = iter(dataset) trainer.run(max_epochs=max_epochs, epoch_length=4)
gives the output:
- 1 / 4 | 1 - batch: 0 ------------------------------------------------------------------------------------------------------------------------ - 1 / 4 | 2 - batch: 1 ------------------------------------------------------------------------------------------------------------------------ - 1 / 4 | 3 - batch: 2 ------------------------------------------------------------------------------------------------------------------------ - 1 / 4 | 4 - batch: 3 ------------------------------------------------------------------------------------------------------------------------ THIS SHOULD NOT BE CALLED - 2 / 4 | 5 - batch: 0 ------------------------------------------------------------------------------------------------------------------------ - 2 / 4 | 6 - batch: 1 ------------------------------------------------------------------------------------------------------------------------ - 2 / 4 | 7 - batch: 2 ------------------------------------------------------------------------------------------------------------------------ - 2 / 4 | 8 - batch: 3 ------------------------------------------------------------------------------------------------------------------------ THIS SHOULD NOT BE CALLED - 3 / 4 | 9 - batch: 0 ------------------------------------------------------------------------------------------------------------------------ - 3 / 4 | 10 - batch: 1 ------------------------------------------------------------------------------------------------------------------------ - 3 / 4 | 11 - batch: 2 ------------------------------------------------------------------------------------------------------------------------ - 3 / 4 | 12 - batch: 3 ------------------------------------------------------------------------------------------------------------------------ THIS SHOULD NOT BE CALLED - 4 / 4 | 13 - batch: 0 ------------------------------------------------------------------------------------------------------------------------ - 4 / 4 | 14 - batch: 1 ------------------------------------------------------------------------------------------------------------------------ - 4 / 4 | 15 - batch: 2 ------------------------------------------------------------------------------------------------------------------------ - 4 / 4 | 16 - batch: 3 ------------------------------------------------------------------------------------------------------------------------
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Reported in this issue: #3189 (comment)
Repro code:
gives the output:
The text was updated successfully, but these errors were encountered: