On Mon, Apr 27, 2009 at 1:12 PM, Whitcomb, Mr. Tim < tim.whitc...@nrlmry.navy.mil> wrote:
> I'm trying to install NumPy 1.3.0 on an IBM Power6. I can build and > install successfully, but when I try to execute the unit test suite it > crashes with a MemoryError (with no additional information on the error > - just the traceback). The failure occurs in test_roundtrip in > numpy/lib/tests/test_format.py and the following snippet reproduces the > error: > > ---------------------------------- > import numpy as np > from cStringIO import StringIO > from numpy.lib import format > > f = StringIO() > a = np.array([], dtype='object') > format.write_array(f, a) > f2 = StringIO(f.getvalue()) > a2 = format.read_array(f2) > > print('%s %s' % (a, a2)) > ----------------------------------- > > On the AIX/PPC install, this crashes with: > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "crash_numpy.py", line 10, in <module> > a2 = format.read_array(f2) > File > "$HOME/.local/python/lib/python2.5/site-packages/numpy/lib/format.py", > line 362, in read_array > array = cPickle.load(fp) > MemoryError > I think this means out of memory, which is probably not correct. What happens if you simply pickle and object array? Something like In [1]: import cPickle In [2]: a = np.array([], dtype='object') In [3]: cPickle.dump(a,open('foo.pkl','w')) In [4]: b = cPickle.load(open('foo.pkl','r')) In [5]: b Out[5]: array([], dtype=object) If that fails, try it using pickle instead of cPickle, then with a non-empty object array like a = np.array([None,None], dtype='object') Chuck
_______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion