Errors while running example pipeline

25 views
Skip to first unread message

Y Wang

unread,
May 17, 2021, 7:52:45 AM5/17/21
to bob-devel
Hello, 

I followed the instruction on this page to run the pipeline example.
I copied the complete pipeline example into a python file, then run the pipelines command.
The error I got was:

  File "/Users/yunwang/AFFACT+AFFFE/test_pipeline.py", line 52, in <module>

    database.allow_scoring_with_all_biometric_references = False

NameError: name 'database' is not defined


Then I remove the last line of the sample code as you told me last time, but I got another error: 

  File "/Users/yunwang/opt/miniconda3/envs/bob_env1/lib/python3.8/site-packages/bob/bio/base/pipelines/vanilla_biometrics/abstract_classes.py", line 125, in score_samples

    self._score_sample_set(

  File "/Users/yunwang/opt/miniconda3/envs/bob_env1/lib/python3.8/site-packages/bob/bio/base/pipelines/vanilla_biometrics/abstract_classes.py", line 154, in _score_sample_set

    scores = self.score_multiple_biometric_references(

  File "/Users/yunwang/opt/miniconda3/envs/bob_env1/lib/python3.8/site-packages/bob/bio/base/pipelines/vanilla_biometrics/abstract_classes.py", line 258, in score_multiple_biometric_references

    raise NotImplementedError(

NotImplementedError: Your BioAlgorithm implementation should implement score_multiple_biometric_references.


Given I test the sample pipeline using the atnt database, how can I fix this issue? How should I define the 'database'  to make the last line of the sample code right?

Thank you!


Manuel Günther

unread,
May 17, 2021, 12:33:40 PM5/17/21
to bob-devel
I believe that the order of the parameters on the command line matter. You haver to first add the "--database"  (or short "-d"). If this is done then the "database" should be in your locals(), which means that you can access it.

Y Wang

unread,
May 17, 2021, 2:22:58 PM5/17/21
to bob-devel
I tried both 2 commands on the documentation and got the same error message.

(1)  on the documentation, for the short version, first adds -d database 

bob bio pipelines vanilla-biometrics -d atnt -p /Users/yunwang/AFFACT+AFFFE/test_pipeline.py -o results

(2) the documentation says: for the long version adding --pipeline first, then --database

bob bio pipelines vanilla-biometrics --pipeline /Users/yunwang/AFFACT+AFFFE/test_pipeline.py --database atnt --output results


But both raise this error:

  File "/Users/yunwang/AFFACT+AFFFE/test_pipeline.py", line 52, in <module>

    database.allow_scoring_with_all_biometric_references = False

NameError: name 'database' is not defined


It seems it's not the problem with the commands.


Amir Mohammadi

unread,
May 18, 2021, 5:05:04 AM5/18/21
to "bob-devel@googlegroups.com", bob-devel
sorry our docs are confusing. I will fix that soon.
Maybe reading this page (Command line interfaces with configurations):
https://www.idiap.ch/software/bob/docs/bob/docs/stable/bob/bob.extension/doc/framework.html#command-line-interfaces-with-configurations
will help you (and Manuel, because what he said will not work) to understand how our new CLI commands work.

Best,
Amir
--
-- You received this message because you are subscribed to the Google Groups bob-devel group. To post to this group, send email to bob-...@googlegroups.com. To unsubscribe from this group, send email to bob-devel+...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/bob-devel or directly the project website at http://idiap.github.com/bob/
---
You received this message because you are subscribed to the Google Groups "bob-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bob-devel+...@googlegroups.com.

Amir Mohammadi

unread,
May 18, 2021, 11:43:12 AM5/18/21
to "bob-devel@googlegroups.com"
In your test_pipeline.py , add:
# pipeline definition
...

from bob.bio.face.config.database.atnt import database
database.allow_scoring_with_all_biometric_references = False
output = "results"
and run like:
bob bio pipelines vanilla-biometrics /Users/yunwang/AFFACT+AFFFE/test_pipeline.py
To create a sample config file run:
bob bio pipelines vanilla-biometrics -H sample_config.py

Best,
Amir

Y Wang

unread,
May 18, 2021, 1:26:12 PM5/18/21
to bob-devel
Hi Amir, 
Thank you for the reply. 
I followed exactly what you said, 
(1)added the following codes in the sample config file test_pipeline.py
       from bob.bio.face.config.database.atnt import database
       database.allow_scoring_with_all_biometric_references = False
       output = "results"

(2)Then, run the command
      bob bio pipelines vanilla-biometrics /Users/yunwang/AFFACT+AFFFE/test_pipeline.py

But I still got the same NotImplementedError message:

  File "/Users/yunwang/opt/miniconda3/envs/bob_env1/lib/python3.8/site-packages/bob/bio/base/pipelines/vanilla_biometrics/abstract_classes.py", line 125, in score_samples

    self._score_sample_set(

  File "/Users/yunwang/opt/miniconda3/envs/bob_env1/lib/python3.8/site-packages/bob/bio/base/pipelines/vanilla_biometrics/abstract_classes.py", line 199, in _score_sample_set

    scores = self.score_multiple_biometric_references(

  File "/Users/yunwang/opt/miniconda3/envs/bob_env1/lib/python3.8/site-packages/bob/bio/base/pipelines/vanilla_biometrics/abstract_classes.py", line 258, in score_multiple_biometric_references

    raise NotImplementedError(

NotImplementedError: Your BioAlgorithm implementation should implement score_multiple_biometric_references.


Amir Mohammadi

unread,
May 19, 2021, 5:50:43 AM5/19/21
to bob-...@googlegroups.com, bob-devel

Y Wang

unread,
May 19, 2021, 5:59:51 AM5/19/21
to bob-devel
Hi Amir,

It's the sample code on the documentation, it should work for users, right?
I test the sample pipeline just to make sure that everything of the pipeline command works fine, so I can define and run my own pipeline. But it's really disappointing that even the sample pipeline doesn't work well.  This is not a bug from my side, I just report this to you, and hope it will be fixed soon.

Thank you

amir.mo...@idiap.ch

unread,
May 19, 2021, 6:18:01 AM5/19/21
to bob-devel
Thank you for your report. It's being fixed in https://gitlab.idiap.ch/bob/bob.bio.base/-/merge_requests/247 already.
Reply all
Reply to author
Forward
0 new messages