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

RuntimeError: cudnn RNN backward can only be called in training mode #4

Open
yurunsheng1 opened this issue Dec 17, 2022 · 0 comments
Open

Comments

@yurunsheng1
Copy link

yurunsheng1 commented Dec 17, 2022

Hi, thank you for sharing the code!

I meet a problem when running your code and really need your help:
It seems like that Middle_Box LSTM model can not work. May i ask you how to address this issue?

Thanks a lot!

Middle_Box LSTM model BestAcc 99.0000
[0/10] LSTM Middle_Box model accuracy 99.00
Traceback (most recent call last):
File "/home/runsheng/XAI/Scripts/run_benchmark.py", line 166, in
main(parse_arguments(sys.argv[1:]))
File "/home/runsheng/XAI/Scripts/run_benchmark.py", line 57, in main
interpret(args,DatasetsTypes,DataGenerationTypes,models,device)
File "/home/runsheng/XAI/Scripts/interpret.py", line 165, in main
attributions = Grad.attribute(input,
File "/home/runsheng/miniconda3/envs/xai/lib/python3.10/site-packages/captum/log/init.py", line 35, in wrapper
return func(*args, **kwargs)
File "/home/runsheng/miniconda3/envs/xai/lib/python3.10/site-packages/captum/attr/_core/saliency.py", line 130, in attribute
gradients = self.gradient_func(
File "/home/runsheng/miniconda3/envs/xai/lib/python3.10/site-packages/captum/_utils/gradient.py", line 119, in compute_gradients
grads = torch.autograd.grad(torch.unbind(outputs), inputs)
File "/home/runsheng/miniconda3/envs/xai/lib/python3.10/site-packages/torch/autograd/init.py", line 276, in grad
return Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass
RuntimeError: cudnn RNN backward can only be called in training mode

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

1 participant