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

Missing module in 'quantus.helpers.utils' #243

Open
PouyaKhn opened this issue Mar 30, 2023 · 2 comments
Open

Missing module in 'quantus.helpers.utils' #243

PouyaKhn opened this issue Mar 30, 2023 · 2 comments

Comments

@PouyaKhn
Copy link

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?

@annahedstroem
Copy link
Member

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!

@xingzhongyu
Copy link

xingzhongyu commented Jul 7, 2023

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

3 participants