[SciPy-user] scipy.test errors (generic ld filter, loadmat case callnest)

Matthew Brett matthew.brett at gmail.com
Thu Sep 14 16:38:46 CDT 2006


Hi,

> > (The ld filter error remains, but has been discussed elsewhere.)
>
> I am getting that error too on an x86_64 machine.  Has it in fact been
> discussed elsewhere?  I think the thread you pointed to was just the
> error report wasn't it?

Actually I've appended a test script that reproduces it; the first
call to ndimage.generic_filter1d works, but the second (in my script:
identical) call generates a memory error, only on my x86_64 machine:

import numpy as N
import scipy.ndimage as ndimage

def _filter_func(input, output, fltr, total):
    fltr = fltr / total
    for ii in range(input.shape[0] - 2):
        output[ii] = input[ii] * fltr[0]
        output[ii] += input[ii + 1] * fltr[1]
        output[ii] += input[ii + 2] * fltr[2]

weights = N.array([1.1, 2.2, 3.3])
type = N.uint8
a = N.arange(12, dtype = type)
a.shape = (3,4)
total = weights.sum()
# No error first time, error second time
for i in range(2):
    print "Iteration %d" % i
    r2 = ndimage.generic_filter1d(a, _filter_func, 3,
                                  axis = 0, origin = -1,
                                  extra_arguments = (weights,),
                                  extra_keywords = {'total': total})


Gives:
[mb312 at foundmachine tmp]$ python nd_debug.py
Iteration 0
Iteration 1
Traceback (most recent call last):
  File "nd_debug.py", line 22, in ?
    extra_keywords = {'total': total})
  File "/home/mb312/lib64/python2.4/site-packages/scipy/ndimage/filters.py",
line 632, in generic_filter1d
    mode, cval, origin, extra_arguments, extra_keywords)
MemoryError

Has anyone got any tips on how I might go about debugging this?
Sorry, I am a novice at debugging extension code.

Best,

Matthew


More information about the SciPy-user mailing list