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

Properly reset train state after render lock in viewer #3486

Merged
merged 2 commits into from
Oct 18, 2024

Conversation

kerrj
Copy link
Collaborator

@kerrj kerrj commented Oct 16, 2024

There were some crashes in the viewer when the training state was set back to train(), instead of keeping the prior state of the model.

@kerrj kerrj requested a review from brentyi October 16, 2024 20:33
raise
self.viewer.get_model().train()
if was_training:
Copy link
Collaborator

Choose a reason for hiding this comment

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

we could do:

finally:
    if was_training:
        self.viewer.get_model().train()

and reduce some duplication?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think this is possible because of the re-raising behavior of the except? is it possible for the finally to run after raising another exception?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh interesting it actually is possible in python, just updated it

Copy link
Collaborator

Choose a reason for hiding this comment

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

oh interesting good point, TIL also!!

@brentyi brentyi merged commit fc4fc5c into main Oct 18, 2024
3 checks passed
@brentyi brentyi deleted the justin/render-train-state branch October 18, 2024 18:38
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.

2 participants