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

On the issue that modifying num_epochs in the nnUNetTrainer.py does not work #2179

Closed
iWangTing opened this issue May 12, 2024 · 4 comments
Closed
Assignees

Comments

@iWangTing
Copy link

Hello, the default 1000 epochs, which is too long for my existing experimental environment to train in, in nnUNetTrainer.py Modify the number of epochs, but it doesn't work, how to deal with it, thank you!

@LambdaLi
Copy link

@iWangTing Just modifying the self.num_epochs in nnUNetTrainer.py, I succeeded by doing so, and that's not difficult. Alternatively, you can create a new Trainer that inherits the original one and then modify what you want to modify within it, all of which are based on my experience.

@ykirchhoff
Copy link
Contributor

Hi @iWangTing,

changing self.num_epochs in the trainer should work. I would still recommend creating your own Trainer class, inheriting from the nnUNetTrainer as @LambdaLi suggested to avoid confusions.

Best,
Yannick

@iWangTing
Copy link
Author

Hi, @ykirchhoff
Thank you for your reply. Although I understand your suggestion, could you please explain in detail the steps to create your own Trainer class.

Best,
Wang

@ykirchhoff
Copy link
Contributor

Hi @iWangTing,

some examples of different trainer classes are given under the variants. Just follow that structure and add you own trainer somewhere down the line from variants (it might make sense to create your own folder, don't forget to include an empty __init__.py file).

Best,
Yannick

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

No branches or pull requests

3 participants