The input to a block gets the object from index method of View while the name from get method of View
I am running an experiment locally using beat.editor. I defined the replay-attack database (using both my own code and the one in beat.examples (https://gitlab.idiap.ch/beat/beat.examples/blob/master/advanced/databases/replay/4.py) (using the grandtest protocol). I get the following error in both cases.
(beat_py3) zmostaani@helvetix02:/remote/idiap.svm/user.active/zmostaani/experiments/beat$ beat exp run zmostaani/zmostaani/sbhatta-iqm-face-antispoofing-test/1/replay2-antispoofing-iqm-lda-2
Index for database replay/2 not found, building it
Index for database replay/2 not found, building it
Index for database replay/2 not found, building it
Running `zmostaani/iqm_features/1' for block `Feats_IQM_Train'
Start the execution of 'zmostaani/iqm_features/1'
Traceback (most recent call last):
File "/idiap/user/zmostaani/miniconda3/envs/beat_py3/bin/beat", line 11, in <module>
sys.exit(main())
File "/idiap/user/zmostaani/miniconda3/envs/beat_py3/lib/python3.6/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/idiap/user/zmostaani/miniconda3/envs/beat_py3/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/idiap/user/zmostaani/miniconda3/envs/beat_py3/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/idiap/user/zmostaani/miniconda3/envs/beat_py3/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/idiap/user/zmostaani/miniconda3/envs/beat_py3/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/idiap/user/zmostaani/miniconda3/envs/beat_py3/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/idiap/user/zmostaani/miniconda3/envs/beat_py3/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/idiap/user/zmostaani/miniconda3/envs/beat_py3/lib/python3.6/site-packages/beat/cmdline/decorators.py", line 75, in _decorator
value = view_func(*args, **kwargs)
File "/idiap/user/zmostaani/miniconda3/envs/beat_py3/lib/python3.6/site-packages/beat/cmdline/experiments.py", line 569, in run
return run_experiment(config, name, force, docker, local, quiet)
File "/idiap/user/zmostaani/miniconda3/envs/beat_py3/lib/python3.6/site-packages/beat/cmdline/experiments.py", line 212, in run_experiment
with executor:
File "/idiap/user/zmostaani/miniconda3/envs/beat_py3/lib/python3.6/site-packages/beat/core/execution/local.py", line 182, in __enter__
self._prepare_inputs()
File "/idiap/user/zmostaani/miniconda3/envs/beat_py3/lib/python3.6/site-packages/beat/core/execution/local.py", line 194, in _prepare_inputs
databases=self.databases
File "/idiap/user/zmostaani/miniconda3/envs/beat_py3/lib/python3.6/site-packages/beat/backend/python/helpers.py", line 195, in create_inputs_from_configuration
start_index=start_index, end_index=end_index)
File "/idiap/user/zmostaani/miniconda3/envs/beat_py3/lib/python3.6/site-packages/beat/backend/python/database.py", line 174, in setup
start_index=start_index, end_index=end_index, pack=pack)
File "/idiap/user/zmostaani/miniconda3/envs/beat_py3/lib/python3.6/site-packages/beat/backend/python/data.py", line 569, in setup
previous_value = getattr(obj, output_name)
AttributeError: 'Entry' object has no attribute 'class'
In get method there is 'class' but in the index there is not, because beat is using namedtuple for making the Entry points and this function does not allow to have name 'class' as an Entry. Even if I define a dictionary instead of namedtuple in my database the python backend is chainging it to namedtuple.
File "/idiap/user/zmostaani/miniconda3/envs/beat_py3/lib/python3.6/site-packages/beat/backend/python/database.py", line 157, in setup
Entry = namedtuple('Entry', sorted(objs[0].keys()))
File "/idiap/user/zmostaani/miniconda3/envs/beat_py3/lib/python3.6/collections/__init__.py", line 404, in namedtuple
'keyword: %r' % name)
ValueError: Type names and field names cannot be a keyword: 'class'
I have two questions
- why not use simple dictionaries in python backend instead of namedtupe
- why the input of block is trying to access objects in index instead of get.
Please let me know if you need more information.
Edited by Jaden DIEFENBAUGH