bad_alloc C++ Exception when running on scface

17 views
Skip to first unread message

ankit.gau...@itbhu.ac.in

unread,
Sep 12, 2016, 2:22:56 PM9/12/16
to bob-devel
When I run the command 

sudo ./bin/baselines.py --all --database scface

Then it gives me C++ exception caught: 'std::bad_alloc' but when I run the same command on database atnt it runs without any error. 
Complete Error


sudo
./bin/baselines.py --all --database scface
[sudo] password for ankit:
bob
.db.frgc@2016-09-10 11:23:59,071 -- WARNING: The database directory '[YOUR_FRGC_DIRECTORY]' does not exist. Please choose the correct path, or correct the path in the Interface.frgc_database_directory() function of the bob/db/frgc/driver.py file.
./bin/faceverify.py --database scface --preprocessing face-crop --features linearize --tool pca --sub-directory baselines/eigenface --groups dev eval
./bin/faceverify.py --database scface --preprocessing face-crop --features eigenfaces --tool lda --sub-directory baselines/lda --groups dev eval
./bin/faceverify.py --database scface --preprocessing tan-triggs --features grid-graph --tool gabor-jet --sub-directory baselines/gaborgraph --groups dev eval
./bin/faceverify.py --database scface --preprocessing tan-triggs --features lgbphs --tool lgbphs --sub-directory baselines/lgbphs --groups dev eval
./bin/faceverify.py --database scface --preprocessing tan-triggs --features dct --tool gmm --sub-directory baselines/gmm --groups dev eval
./bin/faceverify.py --database scface --preprocessing tan-triggs --features dct --tool isv --sub-directory baselines/isv --groups dev eval
./bin/faceverify.py --database scface --preprocessing tan-triggs --features linearize --tool pca+plda --sub-directory baselines/plda --groups dev eval
./bin/faceverify.py --database scface --preprocessing face-crop --features grid-graph --tool bic-jets --sub-directory baselines/bic --groups dev eval
bob
.facereclib@2016-09-10 12:26:00,647 -- ERROR: During the execution, an exception was raised: bob.learn.linear.BICTrainer - train: C++ exception caught: 'std::bad_alloc'
Traceback (most recent call last):
 
File "./bin/faceverify.py", line 58, in <module>
    sys
.exit(facereclib.script.faceverify.main())
 
File "/home/ankit/Downloads/facereclib-2.1.2/facereclib/script/faceverify.py", line 579, in main
    face_verify
(args, command_line_parameters)
 
File "/home/ankit/Downloads/facereclib-2.1.2/facereclib/script/faceverify.py", line 531, in face_verify
    executor
.execute_tool_chain()
 
File "/home/ankit/Downloads/facereclib-2.1.2/facereclib/script/faceverify.py", line 126, in execute_tool_chain
    force
= self.m_args.force)
 
File "/home/ankit/Downloads/facereclib-2.1.2/facereclib/toolchain/ToolChain.py", line 237, in train_enroller
    tool
.train_enroller(train_features, str(enroller_file))
 
File "/home/ankit/Downloads/facereclib-2.1.2/facereclib/tools/BIC.py", line 117, in train_enroller
    trainer
.train(intra_vectors, extra_vectors, self.m_bic_machine)
RuntimeError: bob.learn.linear.BICTrainer - train: C++ exception caught: 'std::bad_alloc'

May anyone please guide me in the right direction as what is happening?

André Anjos

unread,
Sep 12, 2016, 2:47:17 PM9/12/16
to bob-...@googlegroups.com

On Mon, Sep 12, 2016 at 8:22 PM, <ankit.gau...@itbhu.ac.in> wrote:
Then it gives me C++ exception caught: 'std::bad_alloc' but when I run the same command on database atnt it runs without any error. 

You're very likely running out of memory on your machine: http://www.cplusplus.com/reference/new/bad_alloc/

I doubt this is related to Bob code.

Best, Andre


--
Dr. André Anjos
Idiap Research Institute
Centre du Parc - rue Marconi 19
CH-1920 Martigny, Suisse
Phone: +41 27 721 7763
Fax: +41 27 721 7712
http://andreanjos.org

Manuel Günther

unread,
Sep 12, 2016, 3:39:14 PM9/12/16
to bob-devel
I agree with Andre, ``std::bad_alloc``is raised when you run out of (swap) memory. For BIC, you might want to limit the number of training samples using the ``maximum_pair_count`` parameter.

Note that you should -- generally -- be able to run the experiments without sudo rights. Note further that the ``facereclib`` is outdated (and no longer maintained); it is superseded by the ``bob.bio`` packages, see here: http://pythonhosted.org/bob.bio.base/index.html.

Manuel

Reply all
Reply to author
Forward
0 new messages