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

Fix TypeError: Use Class Method for load_from_checkpoint (lightning 2.1.1 onwards) #65

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lauritsf
Copy link

  • Issue Summary: This pull request addresses a TypeError encountered when calling load_from_checkpoint from an instance of a LightningModule since the update to lightning 2.1.1.
  • Technical Details: As outlined in the _restricted_classmethod and load_from_checkpoint implementations, the load_from_checkpoint method must now be called from the class directly.
  • Encountered Issue: Additionally, a potential bug involving inspect.getmembers(model) triggering _restricted_class_method in EnsembleLightningModule was identified. This may require further investigation to determine if it necessitates a workaround or a separate issue to be raised with the lightning team.
  • Action Requested: Feedback and insights on the _restricted_class_method issue and the overall changes are highly appreciated.

@lauritsf lauritsf marked this pull request as draft December 15, 2023 20:41
@lauritsf
Copy link
Author

lauritsf commented Jan 22, 2024

I have opened an issue Lightning-AI/pytorch-lightning#19329 with a suggestion that might solve the problem with inspect.getmembers triggering the TypeError

EDIT:
The issue with inspecting class members has been resolved, so I will revisit this when the change becomes part of a new release.

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.

1 participant