Skip to content

Conversation

@ghostxsl
Copy link
Contributor

@ghostxsl ghostxsl commented Jul 6, 2021

PR types

Others

PR changes

Others

Describe

In the hapi, .fit() and .evaluate() is based on epoch, which is troublesome when users want to train a few iterations.

@paddle-bot-old
Copy link

paddle-bot-old bot commented Jul 6, 2021

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

Choose a reason for hiding this comment

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

assert下num_iters需要大于0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

说明一下None的时候会训练整个epoch,非None的时候训练num_iters次

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@heavengate heavengate changed the title add num_iters in fit/evalate, test=develop add num_iters in fit/evalate Jul 8, 2021
@heavengate heavengate merged commit 97faf90 into PaddlePaddle:develop Jul 8, 2021
self.num_iters = num_iters
if num_iters is not None and isinstance(num_iters, int):
assert num_iters > 0, "num_iters must be greater than 0!"
epochs = (num_iters // steps) + 1
Copy link
Contributor

Choose a reason for hiding this comment

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

data loader是iterable style时, steps是None。 这里会出错。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, PR: #34059

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.

3 participants