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

Got an error when running the Rationale Explainer Sample Notebook (with fixed_classifier = False) #151

Open
ceshine opened this issue Feb 15, 2021 · 0 comments

Comments

@ceshine
Copy link

ceshine commented Feb 15, 2021

When trying to run the Introspective Rationale Explainer Sample Notebook (after going around #150 by using specifying CUDA=True), this error came up:

RuntimeError: one of the variables needed for gradient computation has been modified by an in-place operation: [torch.FloatTensor [50, 150]], which is output 0 of TBackward, is at version 9; expected version 8 instead.

This time the problem seems to be from training the classifier used to feed label to the generator (specifically, this block of code). The notebook can run to the end after commenting out this block (line 232 to 235).

(Update: an alternative workaround is to set fixed_classifier=True and pretrain_cls=True in model_config. This should pre-train the classifier and freeze the classifier weights during generator training.)

(I used PyTorch 1.7 to run the notebook.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant