understandable-machine-intelligence-lab / Quantus

Quantus is an eXplainable AI toolkit for responsible evaluation of neural network explanations

Home Page:https://quantus.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing module in 'quantus.helpers.utils'

PouyaKhn opened this issue · comments

A error just popped up which is required for torch models when I want to evaluate XAI methods:

AttributeError Traceback (most recent call last)
in <cell line: 8>()
6
7 # Call the metric instance to produce scores.
----> 8 results = {method: selectivity(model=model,
9 x_batch=x_batch,
10 y_batch=y_batch,

/usr/local/lib/python3.9/dist-packages/quantus/helpers/model/pytorch_model.py in shape_input(self, x, shape, channel_first, batched)
125 # Set channel order according to expected input of model.
126 if self.channel_first:
--> 127 return utils.make_channel_first(x, channel_first)
128 raise ValueError("Channel first order expected for a torch model.")
129

AttributeError: module 'quantus.helpers.utils' has no attribute 'make_channel_first'

I also checked utils module, but this module already has 'make_channel_first' function. IDK why this error happens?

Can anyone propose a solution?

Hi, thank you for letting us know about this!

Can you give some more context around this call? Is it from a notebook, in that case, which one?

The function make_channel_first do exist in quantus.helpers.utils.

Thanks!