aai-institute / pyDVL

pyDVL is a library of stable implementations of algorithms for data valuation and influence function computation
https://pydvl.org
GNU Lesser General Public License v3.0
89 stars 9 forks source link

NameError: name 'PickleSerde' is not defined #505

Closed seyedamirshobeiri closed 3 months ago

seyedamirshobeiri commented 4 months ago

NameError Traceback (most recent call last)

in <cell line: 5>() 3 from torch.utils.data import DataLoader, TensorDataset 4 ----> 5 from pydvl.influence.torch import DirectInfluence 6 from pydvl.influence.torch.util import NestedTorchCatAggregator, TorchNumpyConverter 7 from pydvl.influence import SequentialInfluenceCalculator

5 frames

/usr/local/lib/python3.10/dist-packages/pydvl/utils/caching/memcached.py in MemcachedClientConfig() 45 timeout: float = 1.0 46 no_delay: bool = True ---> 47 serde: PickleSerde = PickleSerde(pickle_version=PICKLE_VERSION) 48 49

NameError: name 'PickleSerde' is not defined

schroedk commented 4 months ago

Hi @seyedamirshobeiri, thanks for reporting. Could you please provide a minimal working example of what you are trying to do, which produces the error?

My first wild guess would be, that you need to install pydvl with "memcached" extra pip install pyDVL[memcached]

Are you trying to create a MemcachedClientConfig object?

seyedamirshobeiri commented 4 months ago

Thank you.it's work now.Thank you So much for your assistance.

schroedk commented 4 months ago

We should extend the documentation regarding memcached. Also there is an import try/except in the memcached module, which should be either revised or a logging message should be added.

@AnesBenmerzoug , @mdbenito what was the reason for the try/except?

A first inspections shows, that it might be purely related to testing, is this correct?

mdbenito commented 4 months ago

We can move the check to the package __init__.py and only expose the symbols if memcached is available.