Open fcr opened 5 years ago
Presumably the optimized code is the weave version of the code? Maybe you could try to switch to the cythonized version in that case. You can see those being added here: https://github.com/ioam/topographica/blob/f945a8b9fc307a3a32c4fe1296a3e1e37b5491a1/topo/submodel/scal.py#L217
AFAIK I am using the Cython code:
python setup.py build_ext In file included from /Users/fred/anaconda/envs/python2/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1818:0, from /Users/fred/anaconda/envs/python2/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18, from /Users/fred/anaconda/envs/python2/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4, from topo/optimized/optimized.c:567: /Users/fred/anaconda/envs/python2/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
warning "Using deprecated NumPy API, disable it by " \
^
~~ cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Correction. Okay, seems that weave was active. I just remembered that I installed weave when I was first trying to run topographica a few weeks ago, after I ran the LISSOM tutorial and I got this message: "Caution: Unable to import Weave. Will use non-optimized versions of most components. Note: Inline-optimized components are currently disabled; see topo.misc.inlinec".
This was in spite of building with Cython as you saw in my previous message. This is my first time encountering weave.
When I uninstall weave I get back the "Unable to import Weave" message again.
Now that you showed how to activate the cython code in the model I'll give it a try.
Ran with the Cython code. Got the same error: `FloatingPointError Traceback (most recent call last)
Run GCAL_Tutorial.ipynb after building the optimized code. During the stage of "Rebuilding snapshot 'lissom_oo_or_10000.typ' " generally get:
FloatingPointError Traceback (most recent call last)