compute_image_mean throws std::bad_alloc exception

98 views
Skip to first unread message

Viktor Chekanov

unread,
Jul 27, 2017, 6:31:29 AM7/27/17
to Caffe Users
I just installed Caffe on Ubuntu 16.04 with Cuda 8 and cuDNN enabled. Everything worked fine and all final tests were passed.
Now I'm trying to follow a tutorial to understand how Caffe works. For who is interested, the tutorial is this: http://adilmoujahid.com/posts/2016/06/introduction-deep-learning-python-caffe/

The problem is that I'm stucked at the step where I have to generate the mean image of training data. I already have train and test using lmdb format and now I try to use tool compute_image_mean from caffe build/tools/

Basically I try to call that function this way:
compute_image_mean -backend=lmdb /home/ubuntu/deeplearning-cats-dogs-tutorial/input/train_lmdb /home/ubuntu/deeplearning-cats-dogs-tutorial/input/mean.binaryproto

But it results into an error:
I0727 12:27:31.022219  6720 db_lmdb.cpp:35] Opened lmdb /home/ubuntu/deeplearning-cats-dogs-tutorial/input/train_lmdb
terminate called after throwing an instance of
'std::bad_alloc'
  what
():  std::bad_alloc
Aborted (core dumped)


Any idea what can be wrong?

Viktor Chekanov

unread,
Jul 27, 2017, 12:28:30 PM7/27/17
to Caffe Users
This is happening when lmdb database file is empty. I can confirm this bug: https://github.com/BVLC/caffe/issues/4124
Reply all
Reply to author
Forward
0 new messages