Memory error: bad_alloc?

User 2406 | 10/13/2015, 11:36:38 AM

I'm trying to make an SFrame to analyze a folder 'amazon_baby.gl' with product reviews information for sentiment analysis. The folder is only about 40MB big and I have about a GB in memory. Yet I get an error:

/home/anshudwibhashi/Coursera/lib/python2.7/site-packages/graphlab/cython/cysframe.so in graphlab.cython.cysframe.UnitySFrameProxy.head()

/home/anshudwibhashi/Coursera/lib/python2.7/site-packages/graphlab/cython/cysframe.so in graphlab.cython.cysframe.UnitySFrameProxy.head()

MemoryError: std::bad_alloc

I've read a few other posts and they recommend commenting out a certain line in CMakeLists.txt from the graphlab folder, but I can't find such a folder, in the first place...

Thanks!

EDIT: I just checked I have about 800 MB free already!

Comments

User 940 | 10/13/2015, 6:50:46 PM

Hi @Anshuman ,

Do you have a few lines of code that generate this error? This would greatly help us in debugging.

Thanks! -Piotr


User 5194 | 5/13/2016, 3:03:58 PM

Doing this exercise module-5-decision-tree-assignment-1-blank from Coursera

graphlab.version 1.8.3 <== Required for the course samples

small_model.show(view="Tree") Error


MemoryError Traceback (most recent call last) <ipython-input-19-18864a048e14> in <module>() ----> 1 small_model.show(view="Tree")

C:\Users\hbb9279\AppData\Local\Continuum\Anacondados\lib\site-packages\graphlab\toolkits\classifier\decisiontreeclassifier.pyc in show(self, view, treeid, vlabelhover) 211 """ 212 if (view=="Tree"): --> 213 return self.showtree(treeid, vlabelhover=vlabelhover) 214 215 return super(Classifier, self).show(view=view)

C:\Users\hbb9279\AppData\Local\Continuum\Anacondados\lib\site-packages\graphlab\toolkits\classifier\decisiontreeclassifier.pyc in showtree(self, treeid, vlabelhover) 236 >>> model.show(0) 237 """ --> 238 showmodeltree(self, 0, vlabelhover) 239 240 @collectmodel_workflow

C:\Users\hbb9279\AppData\Local\Continuum\Anacondados\lib\site-packages\graphlab\toolkits_supervisedlearning.pyc in showmodeltree(model, treeid, vlabelhover) 761 else: 762 return str(record['name']) + '<' + str(record['value']) --> 763 g.vertices['repr'] = g.vertices.apply(get_vlabel, str) 764 765 fuchsia = [0.69, 0., 0.48]

C:\Users\hbb9279\AppData\Local\Continuum\Anacondados\lib\site-packages\graphlab\datastructures\sframe.pyc in apply(self, fn, dtype, seed) 2912 """ 2913 assert callable(fn), "Input must be callable" -> 2914 testsf = self[:10] 2915 dryrun = [fn(row) for row in test_sf] 2916 if dtype is None:

C:\Users\hbb9279\AppData\Local\Continuum\Anacondados\lib\site-packages\graphlab\datastructures\sframe.pyc in getitem(self, key) 3936 if stop < 0: 3937 stop = len(self) + stop -> 3938 return SFrame(proxy = self.proxy.copy_range(start, step, stop)) 3939 else: 3940 raise TypeError("Invalid index type: must be SArray, list, int, or str")

C:\Users\hbb9279\AppData\Local\Continuum\Anacondados\lib\site-packages\graphlab\datastructures\gframe.pyc in proxy(self) 296 @property 297 def proxy(self): --> 298 return self.get_cache().proxy

C:\Users\hbb9279\AppData\Local\Continuum\Anacondados\lib\site-packages\graphlab\datastructures\gframe.pyc in getcache(self) 280 if self.__sframecache is None or self.isdirty__: 281 if self.isvertexframe(): --> 282 self.sframe_cache = self.graph.getvertices() 283 elif self.isedgeframe(): 284 self.sframe_cache = self.graph.get_edges()

C:\Users\hbb9279\AppData\Local\Continuum\Anacondados\lib\site-packages\graphlab\datastructures\sgraph.pyc in getvertices(self, ids, fields, format) 459 460 with cythoncontext(): --> 461 sf = SFrame(proxy=self.proxy.get_vertices(ids, fields)) 462 463 if (format == 'sframe'):

C:\Users\hbb9279\AppData\Local\Continuum\Anacondados\lib\site-packages\graphlab\cython\context.pyc in exit(self, exctype, excvalue, traceback) 47 if not self.showcythontrace: 48 # To hide cython trace, we re-raise from here ---> 49 raise exctype(excvalue) 50 else: 51 # To show the full trace, we do nothing and let exception propagate

MemoryError: std::bad_alloc


User 1207 | 5/16/2016, 6:57:13 PM

@gerardo_garciag, what version are you using? There was a bug fixed in our latest release that I believe solves this issue.