[SciPy-User] [SciPy-user] scipy.test() curious failure

jajabinker jonathan.alonso@gmail....
Wed Nov 16 09:04:34 CST 2011




Bruce Southey wrote:
> 
> On 11/15/2011 11:04 PM, jajabinker wrote:
>> HI ALL! Hope you can help me!
>>
>> After i run scipy.test() i get the following output:
>>
>> http://pastebin.com/eQwnKDy4
>>
>> Thats that error.
>> Has any1 seen it?
>> I have installed numpy no errors while running numpy.test().
>>
>> In case you spot a bug in my atlas. Here is my configure
>> But the compilation was clean.
>>
>>
>>      ../configure -b 64 -Fa alg -fPIC
>> --prefix=/home/$USER/numpyscipy/atlas
>> --with-netlib-lapack=/home/$USER/numpyscipy/lapack-3.4.0/liblapack.a
>>
>>
>>
>> THANKS!
>>
> I do not get it on Fedora but you using an old gcc (GCC 4.1.2 20080704). 
> I presume that blas etc were compiled with the same version as Python2.7 
> - if not then you should do so.
> 
> What values do you get for the norm(a) in the test from scipy and numpy?
> If you get '1000.0' then perhaps something is not being called correctly 
> as line 13 of scipy/linalg/misc.py is failing on your system:
> 'ord' should be None because of the call
> ' a.ndim == 1' should be 'True'
> 'a.dtype.char' should be 'f'
> 
> Bruce
> 
> $ python
> Python 2.7 (r27:82500, Sep 16 2010, 18:02:00)
> [GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> import scipy as sp
>  >>> import numpy as np
>  >>> import scipy.linalg
>  >>> a = np.array([1e4] + [1]*10000, dtype=np.float32)
>  >>> a
> array([  1.00000000e+04,   1.00000000e+00,   1.00000000e+00, ...,
>           1.00000000e+00,   1.00000000e+00,   1.00000000e+00], 
> dtype=float32)
>  >>> sp.linalg.norm(a)
> 10000.5
>  >>> np.linalg.norm(a)
> 10000.0
>  >>> a.dtype.char
> 'f'
>  >>> a.ndim == 1
> True
>  >>>
> 
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
> 
> 

Hi, thanks for taking the time to reply!

I compiled BLAS as a shared library, but i did not explicitly define the
compiler for either so it should be the same. I will retry though ASAP.

As predicted i get :


>>>> np.linalg.norm(a) 
> 10000.0
> 


> misc.py :def norm(a, ord=None):
>     # Differs from numpy only in non-finite handling and the use of
>     # blas
>     a = np.asarray_chkfinite(a)
>     if ord in (None, 2) and (a.ndim == 1) and (a.dtype.char in 'fdFD'):
>         # use blas for fast and stable euclidean norm
>         func_name = _nrm2_prefix.get(a.dtype.char, 'd') + 'nrm2'
>         nrm2 = getattr(fblas, func_name)
>         return nrm2(a)
>     return np.linalg.norm(a, ord=ord)
> 

-- 
View this message in context: http://old.nabble.com/scipy.test%28%29-curious-failure-tp32852072p32855321.html
Sent from the Scipy-User mailing list archive at Nabble.com.



More information about the SciPy-User mailing list