TS-Interpretability-Benchmark icon indicating copy to clipboard operation
TS-Interpretability-Benchmark copied to clipboard

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

Open yurunsheng1 opened this issue 2 years ago • 0 comments

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

yurunsheng1 avatar Dec 17 '22 08:12 yurunsheng1