[Numpy-discussion] weird numpy/pickle problem

Brian Blais bblais at bryant.edu
Fri Nov 2 12:58:33 EDT 2007


Hello,

I encountered a peculiar numpy and pickle problem.  My version:

	Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04)  Mac OS X Tiger
	In [2]:numpy.__version__
	Out[2]:'1.0.4.dev3869'

I pickle a matrix, and reload it.  Some operations work ok, but  
others give a hardware error and a crash!

I boiled it down to the code below.  Can anyone reproduce (or not)  
this error?


		thanks,

			bb

-- 
Brian Blais
bblais at bryant.edu
http://web.bryant.edu/~bblais

=======================================================================

from numpy import matrix,random
import pickle

w_test=matrix(random.rand(3,21))
fid=open('blah0_test.pickle','wb')
pickle.dump(w_test,fid,0)
fid.close()

fid=open('blah0_test.pickle','rb')
w_xh=pickle.load(fid)
fid.close()

# this works
print w_xh*w_xh.T

#this works
x=matrix(random.rand(2,21))
print x*w_xh.T

# this gives a hardware error!
x=matrix([0]*21)
print x*w_xh.T

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20071102/12cfbe93/attachment.html>


More information about the NumPy-Discussion mailing list