I am following this tutorial to build cat-dog classifier using caffe. But while training I got this error; why?
Asked
Active
Viewed 444 times
0

EverythingNeedToBeKnown
- 115
- 1
- 3
- 18
-
please do not post screen shots - copy-paste the run log and error message. Search engines cannot index screenshots. – Shai Nov 28 '18 at 12:55
1 Answers
0
The error you got "std::bad_alloc"
usually refers to CPU memory allocation: you are out of memory.
Judging by the stack trace, you got the error when trying to read an element from the LMDB file. You need to check your LMDB: is it possible you store HUGE images there? is it possible the LMDB is corrupt? can you read it with different software?

Shai
- 111,146
- 38
- 238
- 371
-
thank you for your reply, in train_lmdb I have stored 23000 images and there are data.mdb and lock.mdb both are 8.2kB in size. how can I read it with different software? which software I can use for it? @Shai – EverythingNeedToBeKnown Nov 29 '18 at 04:02
-
@Cham (1) it does not make sense that lmdb stores 23K images in only 8.2kB. (2) you can use [this example](https://stackoverflow.com/a/33123313/1714410) to scan your lmdb – Shai Nov 29 '18 at 07:20
-
(1) yeah, I thought about it. (2) I'll check this one @Shai – EverythingNeedToBeKnown Nov 29 '18 at 07:32
-
when run that script it doesn't print any. Doesn't give any error. But under problems it says "Datum has no data member" @Shai – EverythingNeedToBeKnown Nov 29 '18 at 07:46
-
@Cham how did you construct your lmdb? it seems like it is corrupted. the entries have only "label" but no image? – Shai Nov 29 '18 at 07:49
-
[link] (https://github.com/adilmoujahid/deeplearning-cats-dogs-tutorial/blob/master/code/create_lmdb.py) this is used @Shai – EverythingNeedToBeKnown Nov 29 '18 at 08:36
-
@Cham I guess you'll have to debug it. did you get any error/warning messages when you created the lmdb? – Shai Nov 29 '18 at 08:42
-
no nothing, they were created nicely without showing any error messages @Sham – EverythingNeedToBeKnown Nov 29 '18 at 08:46
-
@Sham use a debuger to check the creation of your lmdb: i suspect there were no imagefiles found at all and you basically have an empty dataset. – Shai Nov 29 '18 at 08:52
-
I debugged, doesn't show any error. I followed above mentioned tutorial, still can't think what happened. @Shai – EverythingNeedToBeKnown Nov 29 '18 at 09:11
-
Though I installed opencv and import it, always show below messages; Module cv2 has no '...' member . Is this affect this problem? @Shai – EverythingNeedToBeKnown Nov 29 '18 at 09:16