MarkoArsenovic / DeepLearning_PlantDiseases

Training and evaluating state-of-the-art deep learning CNN architectures for plant disease classification task.
Other
222 stars 103 forks source link

Error in function Saliency_map() #5

Open HariniNarasimhan opened 3 years ago

HariniNarasimhan commented 3 years ago

AttributeError Traceback (most recent call last) AttributeError: 'functools.partial' object has no attribute 'name'

The above exception was the direct cause of the following exception:

SystemError Traceback (most recent call last)

in ----> 1 map=Saliency_map(img,model,preprocess,4,use_gpu,method) in Saliency_map(image, model, preprocess, ground_truth, use_gpu, method) 20 energy=output[0,ground_truth] 21 print(energy) ---> 22 energy.backward() 23 grad=input.grad 24 if use_gpu: ~\Anaconda3\lib\site-packages\torch\tensor.py in backward(self, gradient, retain_graph, create_graph) 148 products. Defaults to ``False``. 149 """ --> 150 torch.autograd.backward(self, gradient, retain_graph, create_graph) 151 152 def register_hook(self, hook): ~\Anaconda3\lib\site-packages\torch\autograd\__init__.py in backward(tensors, grad_tensors, retain_graph, create_graph, grad_variables) 97 Variable._execution_engine.run_backward( 98 tensors, grad_tensors, retain_graph, create_graph, ---> 99 allow_unreachable=True) # allow_unreachable flag 100 101 SystemError: PyEval_EvalFrameEx returned a result with an error set