Runtime Error when using FileSelector

18 views
Skip to first unread message

Vedrana Krivokuca

unread,
Nov 8, 2017, 12:53:31 PM11/8/17
to bob-devel
Hello,

I try to do the following in one of my classes (which inherits from bob.bio.base's Algorithm class):

from bob.bio.base.tools.FileSelector import FileSelector
fs = FileSelector.instance()

But I get the following error:

    raise RuntimeError("The class has not yet been instantiated using the 'create' method.")
RuntimeError: The class has not yet been instantiated using the 'create' method.

Why?  I've looked at bob.bio.base.tools.algorithm, for example, and here exactly the same thing is done for fs.

Best regards,
Vedrana

Manuel Günther

unread,
Nov 8, 2017, 1:57:03 PM11/8/17
to bob-devel
Dear Vedrana,

yes, the FileSelector has to be set up (using the create function) before you can use it. Only after you have set it up, you can get the instance using FileSelector.instance().

You can check: https://gitlab.idiap.ch/bob/bob.bio.base/blob/45983b2d464abbf257e91746c91cfdc22d1c7f96/bob/bio/base/tools/command_line.py#L449 to see, how it is set up using the create function. This function is one of the first functions called inside an experiment with bob.bio. Only after that the bob.bio.base.tools.algorithm uses FileSelector.instance().

I hope that helps
Manuel

Vedrana Krivokuca

unread,
Nov 9, 2017, 10:38:46 AM11/9/17
to bob-devel
Thank you, Manuel.
Reply all
Reply to author
Forward
0 new messages