You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/home/qianying/PycharmProjects/DirectionalFeature-master/ES_ED_classfy/expected_gradient.py", line 161, in
expected_gradients = APExp.shap_values(net, inputs)
File "/home/qianying/PycharmProjects/DirectionalFeature-master/ES_ED_classfy/attributionpriors/pytorch_ops.py", line 151, in shap_values
grad_tensor = self._get_grads(samples_input, model, sparse_labels)
File "/home/qianying/PycharmProjects/DirectionalFeature-master/ES_ED_classfy/attributionpriors/pytorch_ops.py", line 120, in _get_grads
sparse_labels.unsqueeze(1)], dim=1)
AttributeError: 'NoneType' object has no attribute 'unsqueeze'
**but actually when we enter into APExp.shap_values(net, inputs), the sparse_labels is default as None.
Traceback (most recent call last):
File "/home/qianying/PycharmProjects/DirectionalFeature-master/ES_ED_classfy/expected_gradient.py", line 161, in
expected_gradients = APExp.shap_values(net, inputs)
File "/home/qianying/PycharmProjects/DirectionalFeature-master/ES_ED_classfy/attributionpriors/pytorch_ops.py", line 151, in shap_values
grad_tensor = self._get_grads(samples_input, model, sparse_labels)
File "/home/qianying/PycharmProjects/DirectionalFeature-master/ES_ED_classfy/attributionpriors/pytorch_ops.py", line 120, in _get_grads
sparse_labels.unsqueeze(1)], dim=1)
AttributeError: 'NoneType' object has no attribute 'unsqueeze'
**but actually when we enter into APExp.shap_values(net, inputs), the sparse_labels is default as None.
def shap_values(self, model, input_tensor, sparse_labels=None,k=1):
please help to solve this problem. thanks**
The text was updated successfully, but these errors were encountered: