-
Notifications
You must be signed in to change notification settings - Fork 396
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
Error predicting when using compile=True
with NeuralNetBinaryClassifier
#1057
Comments
BenjaminBossan
added a commit
that referenced
this issue
May 29, 2024
Fixes #1057 NeuralNetBinaryClassifier was not working with torch.compile because the non-linearity was not correctly inferred. This inference depends on the instance type of the criterion. However, when using torch.compile, the criterion is wrapped, resulting in the isinstance check to miss. Now, we unwrap the criterion before checking the instance type.
Thanks for reporting this error and providing a reproducer. I could identify the issue and created a PR to fix it. In the meantime, you could use a normal |
ottonemo
pushed a commit
that referenced
this issue
May 30, 2024
* FIX NeuralNetBinaryClassifier with torch.compile Fixes #1057 NeuralNetBinaryClassifier was not working with torch.compile because the non-linearity was not correctly inferred. This inference depends on the instance type of the criterion. However, when using torch.compile, the criterion is wrapped, resulting in the isinstance check to miss. Now, we unwrap the criterion before checking the instance type. * Add entry to CHANGES.md
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm using Python 3.11.3, skorch==1.0.0
I find the error disappears when dropping the
compile
argument. It doesn't seem to error for similar examples withNeuralNetClassifier
.Minimal example
Raises
The text was updated successfully, but these errors were encountered: