votchallenge / toolkit

The official VOT Challenge evaluation and analysis toolkit
http://www.votchallenge.net/
GNU General Public License v3.0
153 stars 43 forks source link

Can't run VOT using the 0.1.16 version of attributee #42

Closed nvbln closed 2 years ago

nvbln commented 2 years ago

VOT does not work with the newest version of attributee (0.1.6). Instead, downgrading to 0.1.5 works.

With the newest version of attributee, I get the following error:

  File "/home/akepce/ayca_ncl-lava-nc/venv/bin/vot", line 11, in <module>
    load_entry_point('vot-toolkit==0.5.1', 'console_scripts', 'vot')()
  File "/home/akepce/ayca_ncl-lava-nc/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/akepce/ayca_ncl-lava-nc/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
    return ep.load()
  File "/home/akepce/ayca_ncl-lava-nc/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/home/akepce/ayca_ncl-lava-nc/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2449, in resolve    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/akepce/ayca_ncl-lava-nc/venv/lib/python3.8/site-packages/vot/utilities/cli.py", line 10, in <module>
    from ..stack import resolve_stack, list_integrated_stacks
  File "/home/akepce/ayca_ncl-lava-nc/venv/lib/python3.8/site-packages/vot/stack/__init__.py", line 11, in <module>
    from vot.experiment import Experiment, experiment_registry
  File "/home/akepce/ayca_ncl-lava-nc/venv/lib/python3.8/site-packages/vot/experiment/__init__.py", line 65, in <module>    class Experiment(Attributee):
  File "/home/akepce/ayca_ncl-lava-nc/venv/lib/python3.8/site-packages/vot/experiment/__init__.py", line 70, in Experiment
    transformers = List(Object(transformer_resolver), default=[])
  File "/home/akepce/ayca_ncl-lava-nc/venv/lib/python3.8/site-packages/attributee/containers.py", line 124, in __init__
    super().__init__(**kwargs)
  File "/home/akepce/ayca_ncl-lava-nc/venv/lib/python3.8/site-packages/attributee/__init__.py", line 64, in __init__
    self._default = default if is_undefined(default) else (None if default is None else self.coerce(default, CoerceContext()))
  File "/home/akepce/ayca_ncl-lava-nc/venv/lib/python3.8/site-packages/attributee/containers.py", line 135, in coerce
    if self.readonly:
  File "/home/akepce/ayca_ncl-lava-nc/venv/lib/python3.8/site-packages/attributee/__init__.py", line 84, in readonly
    return self._readonly
AttributeError: 'List' object has no attribute '_readonly'
lukacu commented 2 years ago

Thanks for the report, I will fix it shortly.

Seerkfang commented 2 years ago

I met the same problems and I find that the question is: in vot/experiment::transformers = List(Object(transformer_resolver), default=[]) the default is not none, thus attibutee0.1.6/Attribute::init() will execute the "else...else" choice when meeting self._default = default if is_undefined(default) else (None if default is None else self.coerce(default, {})), which is reloaded in containers::self.readonly. This function would turn to the readonly function in init.py, and the self._readonly hasn't been assigned a value yet (two lines after the assignment of self._default in init.py)!!!

lukacu commented 2 years ago

Yes, I have a fix in repository, but did not manage to release a new version. You can install it from github directly or install 0.1.5

lukacu commented 2 years ago

New version of library available on PyPi, closing the issue.