segfault in scipy.optimize.leastsq
Hello, When running the following example from http://www.tau.ac.il/~kineret/amit/scipy_tutorial I get an segmentationfault in leastsq: -------------------------- from scipy import * from numpy import * x = arange(0,6e-2,6e-2/30) A,k,theta = 10, 1.0/3e-2, pi/6s y_true = A*sin(2*pi*k*x+theta) y_meas = y_true + 2*randn(len(x)) def residuals(p, y, x): A,k,theta = p err = y-A*sin(2*pi*k*x+theta) return err def peval(x, p): return p[0]*sin(2*pi*p[1]*x+p[2]) p0 = [8, 1/2.3e-2, pi/3] print array(p0) from scipy.optimize import leastsq plsq = leastsq(residuals, p0, args=(y_meas, x)) print plsq[0] print array([A, k, theta]) -------------------------- Note that C:\Python24\Lib\site-packages\scipy\optimize\tests\test_optimize.py also gives an error. I'm running Python 2.4.3, Scipy 0.5.0 and numpy 1.0b1. What can be the problem? Greetings, Bas van Dijk
basvandijk@home.nl wrote:
Hello,
When running the following example from http://www.tau.ac.il/~kineret/amit/scipy_tutorial I get an segmentationfault in leastsq:
-------------------------- from scipy import * from numpy import *
x = arange(0,6e-2,6e-2/30) A,k,theta = 10, 1.0/3e-2, pi/6s y_true = A*sin(2*pi*k*x+theta) y_meas = y_true + 2*randn(len(x))
def residuals(p, y, x): A,k,theta = p err = y-A*sin(2*pi*k*x+theta) return err
def peval(x, p): return p[0]*sin(2*pi*p[1]*x+p[2])
p0 = [8, 1/2.3e-2, pi/3] print array(p0)
from scipy.optimize import leastsq plsq = leastsq(residuals, p0, args=(y_meas, x)) print plsq[0]
print array([A, k, theta]) --------------------------
Note that C:\Python24\Lib\site-packages\scipy\optimize\tests\test_optimize.py also gives an error.
I'm running Python 2.4.3, Scipy 0.5.0 and numpy 1.0b1.
What can be the problem?
Greetings,
Bas van Dijk _______________________________________________ SciPy-user mailing list SciPy-user@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-user
I cannot confirm your problems on Linux. python -i /usr/lib64/python2.4/site-packages/scipy/optimize/tests/test_optimize.py Found 6 tests for __main__ ...... ---------------------------------------------------------------------- Ran 6 tests in 0.028s OK The example results in [ 8. 43.47826087 1.04719755] [-10.43031241 33.94233618 3.55891069] [ 10. 33.33333333 0.52359878] 1.0b2.dev2946 0.5.0.2142 Nils
Are you running Windows on an Athlon? john basvandijk@home.nl wrote:
Hello,
When running the following example from http://www.tau.ac.il/~kineret/amit/scipy_tutorial I get an segmentationfault in leastsq:
Note that C:\Python24\Lib\site-packages\scipy\optimize\tests\test_optimize.py also gives an error.
I'm running Python 2.4.3, Scipy 0.5.0 and numpy 1.0b1.
What can be the problem?
Greetings,
Bas van Dijk _______________________________________________ SciPy-user mailing list SciPy-user@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-user
Any chance you have an older AMD processor perhaps not supporting SSE(3?)? -----Original Message----- From: scipy-user-bounces@scipy.org [mailto:scipy-user-bounces@scipy.org] On Behalf Of basvandijk@home.nl Sent: Thursday, August 03, 2006 3:12 PM To: scipy-user@scipy.org Subject: [SciPy-user] segfault in scipy.optimize.leastsq Hello, When running the following example from http://www.tau.ac.il/~kineret/amit/scipy_tutorial I get an segmentationfault in leastsq: -------------------------- from scipy import * from numpy import * x = arange(0,6e-2,6e-2/30) A,k,theta = 10, 1.0/3e-2, pi/6s y_true = A*sin(2*pi*k*x+theta) y_meas = y_true + 2*randn(len(x)) def residuals(p, y, x): A,k,theta = p err = y-A*sin(2*pi*k*x+theta) return err def peval(x, p): return p[0]*sin(2*pi*p[1]*x+p[2]) p0 = [8, 1/2.3e-2, pi/3] print array(p0) from scipy.optimize import leastsq plsq = leastsq(residuals, p0, args=(y_meas, x)) print plsq[0] print array([A, k, theta]) -------------------------- Note that C:\Python24\Lib\site-packages\scipy\optimize\tests\test_optimize.py also gives an error. I'm running Python 2.4.3, Scipy 0.5.0 and numpy 1.0b1. What can be the problem? Greetings, Bas van Dijk _______________________________________________ SciPy-user mailing list SciPy-user@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-user
Jelle Feringa / EZCT Architecture & Design Research wrote:
Any chance you have an older AMD processor perhaps not supporting SSE(3?)?
In case of a segfault I suggest to use gdb to track down the problem. Nils
-----Original Message----- From: scipy-user-bounces@scipy.org [mailto:scipy-user-bounces@scipy.org] On Behalf Of basvandijk@home.nl Sent: Thursday, August 03, 2006 3:12 PM To: scipy-user@scipy.org Subject: [SciPy-user] segfault in scipy.optimize.leastsq
Hello,
When running the following example from http://www.tau.ac.il/~kineret/amit/scipy_tutorial I get an segmentationfault in leastsq:
-------------------------- from scipy import * from numpy import *
x = arange(0,6e-2,6e-2/30) A,k,theta = 10, 1.0/3e-2, pi/6s y_true = A*sin(2*pi*k*x+theta) y_meas = y_true + 2*randn(len(x))
def residuals(p, y, x): A,k,theta = p err = y-A*sin(2*pi*k*x+theta) return err
def peval(x, p): return p[0]*sin(2*pi*p[1]*x+p[2])
p0 = [8, 1/2.3e-2, pi/3] print array(p0)
from scipy.optimize import leastsq plsq = leastsq(residuals, p0, args=(y_meas, x)) print plsq[0]
print array([A, k, theta]) --------------------------
Note that C:\Python24\Lib\site-packages\scipy\optimize\tests\test_optimize.py also gives an error.
I'm running Python 2.4.3, Scipy 0.5.0 and numpy 1.0b1.
What can be the problem?
Greetings,
Bas van Dijk _______________________________________________ SciPy-user mailing list SciPy-user@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-user
_______________________________________________ SciPy-user mailing list SciPy-user@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-user
Hello,
When running the following example from http://www.tau.ac.il/~kineret/amit/scipy_tutorial I get an segmentationfault in leastsq:
-------------------------- from scipy import * from numpy import *
x = arange(0,6e-2,6e-2/30) A,k,theta = 10, 1.0/3e-2, pi/6s y_true = A*sin(2*pi*k*x+theta) y_meas = y_true + 2*randn(len(x))
def residuals(p, y, x): A,k,theta = p err = y-A*sin(2*pi*k*x+theta) return err
def peval(x, p): return p[0]*sin(2*pi*p[1]*x+p[2])
p0 = [8, 1/2.3e-2, pi/3] print array(p0)
from scipy.optimize import leastsq plsq = leastsq(residuals, p0, args=(y_meas, x)) print plsq[0]
print array([A, k, theta]) --------------------------
Note that C:\Python24\Lib\site-packages\scipy\optimize\tests\test_optimize.py also gives an error.
I'm running Python 2.4.3, Scipy 0.5.0 and numpy 1.0b1.
What can be the problem?
Greetings,
Bas van Dijk Sounds familar to me. I had a similar problem with older scipy and numpy versions. For me it worked after using ATLAS without SSE support. But
basvandijk@home.nl wrote: that was an ATHLON and not an Pentium 2. You can find the old thred here: http://thread.gmane.org/gmane.comp.python.scientific.user/8139/focus=8139 Hans Georg
Dr. Hans Georg Krauthaeuser wrote:
basvandijk@home.nl wrote:
Hello,
When running the following example from http://www.tau.ac.il/~kineret/amit/scipy_tutorial I get an segmentationfault in leastsq:
-------------------------- from scipy import * from numpy import *
x = arange(0,6e-2,6e-2/30) A,k,theta = 10, 1.0/3e-2, pi/6s y_true = A*sin(2*pi*k*x+theta) y_meas = y_true + 2*randn(len(x))
def residuals(p, y, x): A,k,theta = p err = y-A*sin(2*pi*k*x+theta) return err
def peval(x, p): return p[0]*sin(2*pi*p[1]*x+p[2])
p0 = [8, 1/2.3e-2, pi/3] print array(p0)
from scipy.optimize import leastsq plsq = leastsq(residuals, p0, args=(y_meas, x)) print plsq[0]
print array([A, k, theta]) --------------------------
Note that C:\Python24\Lib\site-packages\scipy\optimize\tests\test_optimize.py also gives an error.
I'm running Python 2.4.3, Scipy 0.5.0 and numpy 1.0b1.
What can be the problem?
Greetings,
Bas van Dijk
Sounds familar to me. I had a similar problem with older scipy and numpy versions. For me it worked after using ATLAS without SSE support. But that was an ATHLON and not an Pentium 2.
You can find the old thred here: http://thread.gmane.org/gmane.comp.python.scientific.user/8139/focus=8139
Hans Georg
_______________________________________________ SciPy-user mailing list SciPy-user@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-user
Interesting. There seems to be more SSE related problems. How do I disable SSE support ? Nils
Nils Wagner wrote:
Interesting. There seems to be more SSE related problems. How do I disable SSE support ?
Nils
Nils, I compiled ATLAS by myself on that computer. ATLAS detects whether to use SSE or not during the build. Of course you have to compile/link numpy and scipy (or only numpy?) against this ATLAS. Ed Schofield uploaded precompiles ATLAS binaries to http://www.scipy.org/Installing_SciPy/Windows This may save some time... BTW, isn't there any way to dynamically link against the ATLAS library? Hans Georg
On Thu, 03 Aug 2006 16:32:16 +0200 "Dr. Hans Georg Krauthaeuser" <hgk@et.uni-magdeburg.de> wrote:
Nils Wagner wrote:
Interesting. There seems to be more SSE related problems. How do I disable SSE support ?
Nils
Nils,
I compiled ATLAS by myself on that computer. ATLAS detects whether to use SSE or not during the build.
But is there a way to enforce ATLAS not to use SSE ? Nils Of course you have to
compile/link numpy and scipy (or only numpy?) against this ATLAS.
Ed Schofield uploaded precompiles ATLAS binaries to http://www.scipy.org/Installing_SciPy/Windows
This may save some time...
BTW, isn't there any way to dynamically link against the ATLAS library?
Hans Georg
_______________________________________________ SciPy-user mailing list SciPy-user@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-user
Why would you if you havent got an explicit SSE related problem? But is there a way to enforce ATLAS not to use SSE ? Nils
participants (5)
-
basvandijkļ¼ home.nl -
Dr. Hans Georg Krauthaeuser -
Jelle Feringa / EZCT Architecture & Design Research -
John Hassler -
Nils Wagner