svenpeter42 / fastfilters Goto Github PK
View Code? Open in Web Editor NEWOld academic project for my PhD - no longer maintained by me: fast gaussian and derivative convolutional filters
License: MIT License
Old academic project for my PhD - no longer maintained by me: fast gaussian and derivative convolutional filters
License: MIT License
Stepts to reproduce by @stuarteberg ilastik/ilastik#1477 (comment)
Happens to me now as well.
With feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW); the first fp exception happens in the eigenvalue computation for 3D, possibly because the results of the previous convolutions are already wrong or because the EV code has some instabilities when used with relaxed FP rules.
The bug disappears when I disable -ffast-math at a significant speed penalty.
Program received signal SIGFPE, Arithmetic exception.
_ev3d_avx2 (a00=0xc22f80, a01=0xc25c50, a02=0xc24d60, a11=0xc00870, a12=0xc23e70, a22=0xbd25b0, ev0=<optimized out>, ev1=<optimized out>, ev2=<optimized out>, len=<optimized out>) at /home/speter/miniconda3/conda-bld/fastfilters_1507908730174/work/build_conda/linalg_avx2.avx2.c:78
78 q = _mm256_min_ps(q, zero);
(gdb) bt
#0 _ev3d_avx2 (a00=0xc22f80, a01=0xc25c50, a02=0xc24d60, a11=0xc00870, a12=0xc23e70, a22=0xbd25b0, ev0=<optimized out>, ev1=<optimized out>, ev2=<optimized out>, len=<optimized out>)
at /home/speter/miniconda3/conda-bld/fastfilters_1507908730174/work/build_conda/linalg_avx2.avx2.c:78
#1 0x00007fffe7bbb301 in (anonymous namespace)::filter_ev_3d_binding<(anonymous namespace)::ConvolveST> (input=..., fn=...) from /home/speter/miniconda3/envs/fastfilter-dev/lib/python3.5/site-packages/fastfilters/core.cpython-35m-x86_64-linux-gnu.so
#2 0x00007fffe7bb7424 in (anonymous namespace)::<lambda(pybind11::array_t<float, 17>&, double, double, float)>::operator()(pybind11::array_t<float, 17> &, double, double, float) const (__closure=0xbcec08, input=..., E#0=1, E#1=0.5, window_ratio=2)
from /home/speter/miniconda3/envs/fastfilter-dev/lib/python3.5/site-packages/fastfilters/core.cpython-35m-x86_64-linux-gnu.so
#3 0x00007fffe7bc37c6 in pybind11::detail::type_caster<std::tuple<pybind11::array_t<float, 17>&, double, double, float>, void>::call<pybind11::array_t<float>, (anonymous namespace)::bind2d3d_ev(pybind11::module&, std::__cxx11::string) [with ConvolveFunctor = (anonymous namespace)::ConvolveST; args = {double, double}; std::__cxx11::string = std::__cxx11::basic_string<char>]::<lambda(pybind11::array_t<float, 17>&, double, double, float)>&, 0ul, 1ul, 2ul, 3ul>((anonymous namespace)::<lambda(pybind11::array_t<float, 17>&, double, double, float)> &, pybind11::detail::index_sequence<0ul, 1ul, 2ul, 3ul>) (this=0x7fffffffcf70, f=...) from /home/speter/miniconda3/envs/fastfilter-dev/lib/python3.5/site-packages/fastfilters/core.cpython-35m-x86_64-linux-gnu.so
#4 0x00007fffe7bc2a8f in pybind11::detail::type_caster<std::tuple<pybind11::array_t<float, 17>&, double, double, float>, void>::call<pybind11::array_t<float>, (anonymous namespace)::bind2d3d_ev(pybind11::module&, std::__cxx11::string) [with ConvolveFunctor = (anonymous namespace)::ConvolveST; args = {double, double}; std::__cxx11::string = std::__cxx11::basic_string<char>]::<lambda(pybind11::array_t<float, 17>&, double, double, float)>&>((anonymous namespace)::<lambda(pybind11::array_t<float, 17>&, double, double, float)> &) (this=0x7fffffffcf70, f=...)
from /home/speter/miniconda3/envs/fastfilter-dev/lib/python3.5/site-packages/fastfilters/core.cpython-35m-x86_64-linux-gnu.so
#5 0x00007fffe7bc14b4 in pybind11::cpp_function::<lambda(pybind11::detail::function_record*, pybind11::handle, pybind11::handle, pybind11::handle)>::operator()(pybind11::detail::function_record *, pybind11::handle, pybind11::handle, pybind11::handle) const (__closure=0x0,
rec=0xbcebd0, args=..., kwargs=..., parent=...) from /home/speter/miniconda3/envs/fastfilter-dev/lib/python3.5/site-packages/fastfilters/core.cpython-35m-x86_64-linux-gnu.so
#6 0x00007fffe7bc15e5 in pybind11::cpp_function::<lambda(pybind11::detail::function_record*, pybind11::handle, pybind11::handle, pybind11::handle)>::_FUN(pybind11::detail::function_record *, pybind11::handle, pybind11::handle, pybind11::handle) ()
from /home/speter/miniconda3/envs/fastfilter-dev/lib/python3.5/site-packages/fastfilters/core.cpython-35m-x86_64-linux-gnu.so
#7 0x00007fffe7bc928c in pybind11::cpp_function::dispatcher (self=0x7fffec4cf600, args=0x7fffe75d7818, kwargs=0x0) from /home/speter/miniconda3/envs/fastfilter-dev/lib/python3.5/site-packages/fastfilters/core.cpython-35m-x86_64-linux-gnu.so
#8 0x00007ffff79a0dd1 in PyCFunction_Call (func=0x7fffe9122708, args=0x7fffe75d7818, kwds=<optimized out>) at Objects/methodobject.c:98
#9 0x00007ffff7a294a6 in call_function (oparg=<optimized out>, pp_stack=0x7fffffffd3d8) at Python/ceval.c:4720
#10 PyEval_EvalFrameEx (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3251
#11 0x00007ffff7a29fc9 in _PyEval_EvalCodeWithName (_co=<optimized out>, globals=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=4, kws=0x7ffff7f79060, kwcount=0, defs=0x7ffff1003e60, defcount=1, kwdefs=0x0, closure=0x0, name=0x0, qualname=0x0)
at Python/ceval.c:4033
#12 0x00007ffff7a2a158 in PyEval_EvalCodeEx (_co=<optimized out>, globals=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=<optimized out>, kws=<optimized out>, kwcount=0, defs=0x7ffff1003e60, defcount=1, kwdefs=0x0, closure=0x0) at Python/ceval.c:4054
#13 0x00007ffff797ec91 in function_call (func=0x7fffe91299d8, arg=0x7fffe9116f98, kw=0x7ffff7edd848) at Objects/funcobject.c:627
#14 0x00007ffff794b4c6 in PyObject_Call (func=0x7fffe91299d8, arg=<optimized out>, kw=<optimized out>) at Objects/abstract.c:2166
#15 0x00007ffff7a26286 in ext_do_call (nk=-384733288, na=1, flags=<optimized out>, pp_stack=0x7fffffffd728, func=0x7fffe91299d8) at Python/ceval.c:5049
#16 PyEval_EvalFrameEx (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3290
#17 0x00007ffff7a29fc9 in _PyEval_EvalCodeWithName (_co=<optimized out>, globals=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=4, kws=0x7ffff7f719c8, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x7fffee902978, name=0x7ffff0bc3370,
qualname=0x7ffff0ff7fa8) at Python/ceval.c:4033
#18 0x00007ffff7a2813d in fast_function (nk=<optimized out>, na=4, n=<optimized out>, pp_stack=0x7fffffffd948, func=0x7fffe9129a60) at Python/ceval.c:4828
#19 call_function (oparg=<optimized out>, pp_stack=0x7fffffffd948) at Python/ceval.c:4745
#20 PyEval_EvalFrameEx (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3251
#21 0x00007ffff7a29fc9 in _PyEval_EvalCodeWithName (_co=<optimized out>, globals=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0, name=0x0, qualname=0x0) at Python/ceval.c:4033
#22 0x00007ffff7a2a158 in PyEval_EvalCodeEx (_co=<optimized out>, globals=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=<optimized out>, kws=<optimized out>, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:4054
#23 0x00007ffff7a2a19b in PyEval_EvalCode (co=<optimized out>, globals=<optimized out>, locals=<optimized out>) at Python/ceval.c:777
#24 0x00007ffff7a4f410 in run_mod (arena=0x6611b0, flags=0x7fffffffdc90, locals=0x7ffff7f27208, globals=0x7ffff7f27208, filename=0x7ffff7e4e260, mod=0x6c0de0) at Python/pythonrun.c:982
#25 PyRun_FileExFlags (fp=0x660f80, filename_str=<optimized out>, start=<optimized out>, globals=0x7ffff7f27208, locals=0x7ffff7f27208, closeit=<optimized out>, flags=0x7fffffffdc90) at Python/pythonrun.c:935
#26 0x00007ffff7a50a03 in PyRun_SimpleFileExFlags (fp=0x660f80, filename=<optimized out>, closeit=1, flags=0x7fffffffdc90) at Python/pythonrun.c:402
#27 0x00007ffff7a6bce7 in run_file (p_cf=0x7fffffffdc90, filename=0x603320 L"blah.py", fp=0x660f80) at Modules/main.c:318
#28 Py_Main (argc=<optimized out>, argv=<optimized out>) at Modules/main.c:769
#29 0x0000000000400bbd in main (argc=2, argv=0x7fffffffde08) at ./Programs/python.c:65
Hi,
I tried to build the conda package because I need a python 3 version (I couldn't find it on the ilastik channel, is there one anywhere else). However, I can't build the package with any python version. I always obtain the following error:
Traceback (most recent call last):
File "/home/consti/software/miniconda/bin/conda-build", line 6, in <module>
sys.exit(conda_build.cli.main_build.main())
File "/home/consti/software/miniconda/lib/python2.7/site-packages/conda_build/cli/main_build.py", line 387, in main
execute(sys.argv[1:])
File "/home/consti/software/miniconda/lib/python2.7/site-packages/conda_build/cli/main_build.py", line 378, in execute
noverify=args.no_verify)
File "/home/consti/software/miniconda/lib/python2.7/site-packages/conda_build/api.py", line 184, in build
need_source_download=need_source_download, config=config, variants=variants)
File "/home/consti/software/miniconda/lib/python2.7/site-packages/conda_build/build.py", line 1715, in build_tree
notest=notest,
File "/home/consti/software/miniconda/lib/python2.7/site-packages/conda_build/build.py", line 1002, in build
always_include_files=m.always_include_files())
File "/home/consti/software/miniconda/lib/python2.7/site-packages/conda_build/environ.py", line 792, in create_env
execute_actions(actions, index, verbose=config.debug)
File "/home/consti/software/miniconda/lib/python2.7/site-packages/conda/plan.py", line 830, in execute_actions
execute_instructions(plan, index, verbose)
File "/home/consti/software/miniconda/lib/python2.7/site-packages/conda/instructions.py", line 247, in execute_instructions
cmd(state, arg)
File "/home/consti/software/miniconda/lib/python2.7/site-packages/conda/instructions.py", line 108, in UNLINKLINKTRANSACTION_CMD
txn.execute()
File "/home/consti/software/miniconda/lib/python2.7/site-packages/conda/core/link.py", line 297, in execute
rollback_excs,
conda.CondaMultiError: post-link script failed for package defaults::gcc-4.8.5-7
running your command again with `-v` will provide additional information
location of failed script: /home/consti/software/miniconda/conda-bld/fastfilters_1502243349072/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/bin/.gcc-post-link.sh
==> script messages <==
<None>
just needs some sanity checking. test case adapted from #13
import fastfilters
import numpy as np
data = np.random.normal(size=(200, 200, 2))
data = fastfilters.hessianOfGaussianEigenvalues(data, window_size=3.5, scale=3.5)
Hi,
I need a conda python 3.6 version of fastfilters.
However the meta.yaml allows builds only with 3.4 and 3.5:
https://github.com/svenpeter42/fastfilters/blob/master/pkg/conda/fastfilters/meta.yaml#L24
Is there any specific reason for this restriction?
I've encoutered segmentation faults while running code in a ipython notebook using fastfilters to validate a model to be used in ilastik. I've managed to narrow it down to this minimal case to trigger it:
import fastfilters
import numpy as np
data = np.random.normal(size=(200, 200))
data = fastfilters.hessianOfGaussianEigenvalues(data, window_size=3.5, scale=3.5)
data = fastfilters.structureTensorEigenvalues(data, window_size=3.5, innerScale=3.5, outerScale=3.5)
It seems to occur in fir_convolve_impl_mirror_mirror_antisymmetric_avxfmaN as seen in the crash report attached below.
python3.6_2017-10-10-123502_MacBook-Pro.crash.txt
This was using fastfilters compiled from the latest master at the time of this post: 1f8d11a
When I build the conda recipe, I see a test failure in a test that compares with vigra. Since the fastfilters
code hasn't changed in a while, the failure is presumably caused by some change in vigra. Do you have any clue what could be going wrong?
TEST START: fastfilters-0.2.4-py27_0_g649a633
updating index in: /miniconda2/conda-bld/osx-64
updating index in: /miniconda2/conda-bld/noarch
The following packages will be downloaded:
package | build
---------------------------|-----------------
fastfilters-0.2.4 | py27_0_g649a633 531 KB local
The following NEW packages will be INSTALLED:
boost: 1.55.0-5 ilastik
fastfilters: 0.2.4-py27_0_g649a633 local
fftw: 3.3.4-1 ilastik
h5py: 2.6.0-np111py27_1
hdf5: 1.8.16-0
jbig: 2.1-0 ilastik
jpeg: 8d-2
lemon: 1.2.4-2 ilastik
libgcc: 4.8.5-1
libpng: 1.6.17-0
libtiff: 4.0.6-1 ilastik
mkl: 11.3.3-0
nose: 1.3.7-py27_1
numpy: 1.11.2-py27_0
openssl: 1.0.2j-0
pip: 9.0.1-py27_1
python: 2.7.13-0
readline: 6.2-2
setuptools: 27.2.0-py27_0
six: 1.10.0-py27_0
sqlite: 3.13.0-0
tk: 8.5.18-0
vigra: 1.11.0.post199-np111py27_0_g48b7d43 local
wheel: 0.29.0-py27_0
xz: 5.2.2-1
zlib: 1.2.8-3
WARNING: conda-build appears to be out of date. You have version 2.0.10 but the
latest version is 2.1.0. Run
conda update -n root conda-build
to get the latest version.
+ source /miniconda2/bin/activate /miniconda2/conda-bld/fastfilters_1483747753253/_t_env
+ /miniconda2/conda-bld/fastfilters_1483747753253/_t_env/bin/python -s /miniconda2/conda-bld/fastfilters_1483747753253/test_tmp/run_test.py
===== testing package: fastfilters-0.2.4-py27_0_g649a633 =====
import: u'fastfilters'
===== fastfilters-0.2.4-py27_0_g649a633 OK =====
+ /bin/bash -x -e /miniconda2/conda-bld/fastfilters_1483747753253/test_tmp/run_test.sh
+ python /miniconda2/conda-bld/fastfilters_1483747753253/work/tests/vigra_compare.py compare-success.txt
('gaussian ', 0, 1.0, 2.3841858e-07)
('gaussian ', 0, 5.0, 1.1920929e-07)
('gaussian ', 0, 10.0, 5.2154064e-08)
('gaussian ', 1, 1.0, 1.1920929e-07)
('gaussian ', 1, 5.0, 0.00011882256)
Traceback (most recent call last):
File "/miniconda2/conda-bld/fastfilters_1483747753253/work/tests/vigra_compare.py", line 26, in <module>
raise Exception("FAIL: ", order, sigma, np.max(np.abs(res_ff - res_vigra)))
Exception: ('FAIL: ', 1, 5.0, 0.00011882256)
TESTS FAILED: fastfilters-0.2.4-py27_0_g649a633
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.