Open djinnome opened 5 years ago
Same issue with wu2004.ipynb
The error occurs on cell 13:
You can find the C code in this temporary file: /var/folders/z1/nhct2gps3y94tkbwqvvd7y_jw6p1l8/T/theano_compilation_error_mc81tk60
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
<ipython-input-13-83ffbe87ff2c> in <module>
6
7 # Calculate steady-state concentrations and fluxes from elasticities
----> 8 chi_ss, v_hat_ss = ll.steady_state_theano(Ex_t, Ey_t, en, yn)
9
10 # Error distributions for observed steady-state concentrations and fluxes
~/.pyenv/versions/miniconda3-latest/envs/idp_new/lib/python3.6/site-packages/emll/linlog_model.py in steady_state_theano(self, Ex, Ey, en, yn, method)
144 yn = T.as_tensor_variable(yn)
145
--> 146 e_diag = en.dimshuffle(0, 1, 'x') * np.diag(self.v_star)
147 N_rep = self.Nr.reshape((-1, *self.Nr.shape)).repeat(n_exp, axis=0)
148 N_hat = T.batched_dot(N_rep, e_diag)
~/.pyenv/versions/miniconda3-latest/envs/idp_new/lib/python3.6/site-packages/theano/tensor/var.py in __mul__(self, other)
153 # and the return value in that case
154 try:
--> 155 return theano.tensor.mul(self, other)
156 except (NotImplementedError, AsTensorError):
157 return NotImplemented
~/.pyenv/versions/miniconda3-latest/envs/idp_new/lib/python3.6/site-packages/theano/gof/op.py in __call__(self, *inputs, **kwargs)
668 # compute output value once with test inputs to validate graph
669 thunk = node.op.make_thunk(node, storage_map, compute_map,
--> 670 no_recycling=[])
671 thunk.inputs = [storage_map[v] for v in node.inputs]
672 thunk.outputs = [storage_map[v] for v in node.outputs]
~/.pyenv/versions/miniconda3-latest/envs/idp_new/lib/python3.6/site-packages/theano/gof/op.py in make_thunk(self, node, storage_map, compute_map, no_recycling, impl)
953 try:
954 return self.make_c_thunk(node, storage_map, compute_map,
--> 955 no_recycling)
956 except (NotImplementedError, utils.MethodNotDefined):
957 # We requested the c code, so don't catch the error.
~/.pyenv/versions/miniconda3-latest/envs/idp_new/lib/python3.6/site-packages/theano/gof/op.py in make_c_thunk(self, node, storage_map, compute_map, no_recycling)
856 _logger.debug('Trying CLinker.make_thunk')
857 outputs = cl.make_thunk(input_storage=node_input_storage,
--> 858 output_storage=node_output_storage)
859 thunk, node_input_filters, node_output_filters = outputs
860
~/.pyenv/versions/miniconda3-latest/envs/idp_new/lib/python3.6/site-packages/theano/gof/cc.py in make_thunk(self, input_storage, output_storage, storage_map, keep_lock)
1215 cthunk, module, in_storage, out_storage, error_storage = self.__compile__(
1216 input_storage, output_storage, storage_map,
-> 1217 keep_lock=keep_lock)
1218
1219 res = _CThunk(cthunk, init_tasks, tasks, error_storage, module)
~/.pyenv/versions/miniconda3-latest/envs/idp_new/lib/python3.6/site-packages/theano/gof/cc.py in __compile__(self, input_storage, output_storage, storage_map, keep_lock)
1155 output_storage,
1156 storage_map,
-> 1157 keep_lock=keep_lock)
1158 return (thunk,
1159 module,
~/.pyenv/versions/miniconda3-latest/envs/idp_new/lib/python3.6/site-packages/theano/gof/cc.py in cthunk_factory(self, error_storage, in_storage, out_storage, storage_map, keep_lock)
1618 node.op.prepare_node(node, storage_map, None, 'c')
1619 module = get_module_cache().module_from_key(
-> 1620 key=key, lnk=self, keep_lock=keep_lock)
1621
1622 vars = self.inputs + self.outputs + self.orphans
~/.pyenv/versions/miniconda3-latest/envs/idp_new/lib/python3.6/site-packages/theano/gof/cmodule.py in module_from_key(self, key, lnk, keep_lock)
1179 try:
1180 location = dlimport_workdir(self.dirname)
-> 1181 module = lnk.compile_cmodule(location)
1182 name = module.__file__
1183 assert name.startswith(location)
~/.pyenv/versions/miniconda3-latest/envs/idp_new/lib/python3.6/site-packages/theano/gof/cc.py in compile_cmodule(self, location)
1521 lib_dirs=self.lib_dirs(),
1522 libs=libs,
-> 1523 preargs=preargs)
1524 except Exception as e:
1525 e.args += (str(self.fgraph),)
~/.pyenv/versions/miniconda3-latest/envs/idp_new/lib/python3.6/site-packages/theano/gof/cmodule.py in compile_str(module_name, src_code, location, include_dirs, lib_dirs, libs, preargs, py_module, hide_symbols)
2386 # difficult to read.
2387 raise Exception('Compilation failed (return status=%s): %s' %
-> 2388 (status, compile_stderr.replace('\n', '. ')))
2389 elif config.cmodule.compilation_warning and compile_stderr:
2390 # Print errors just below the command line.
Exception: ("Compilation failed (return status=1): /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpf6wtnpmc/mod.cpp:550:27: error: non-constant-expression cannot be narrowed from type 'npy_intp' (aka 'long') to 'int' in initializer list [-Wc++11-narrowing]. int init_totals[3] = {V3_n0, V3_n1, V5_n2};. ^~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpf6wtnpmc/mod.cpp:550:27: note: insert an explicit cast to silence this issue. int init_totals[3] = {V3_n0, V3_n1, V5_n2};. ^~~~~. static_cast<int>( ). /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpf6wtnpmc/mod.cpp:550:34: error: non-constant-expression cannot be narrowed from type 'npy_intp' (aka 'long') to 'int' in initializer list [-Wc++11-narrowing]. int init_totals[3] = {V3_n0, V3_n1, V5_n2};. ^~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpf6wtnpmc/mod.cpp:550:34: note: insert an explicit cast to silence this issue. int init_totals[3] = {V3_n0, V3_n1, V5_n2};. ^~~~~. static_cast<int>( ). /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpf6wtnpmc/mod.cpp:550:41: error: non-constant-expression cannot be narrowed from type 'npy_intp' (aka 'long') to 'int' in initializer list [-Wc++11-narrowing]. int init_totals[3] = {V3_n0, V3_n1, V5_n2};. ^~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpf6wtnpmc/mod.cpp:550:41: note: insert an explicit cast to silence this issue. int init_totals[3] = {V3_n0, V3_n1, V5_n2};. ^~~~~. static_cast<int>( ). /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpf6wtnpmc/mod.cpp:565:9: error: non-constant-expression cannot be narrowed from type 'ssize_t' (aka 'long') to 'int' in initializer list [-Wc++11-narrowing]. V3_stride0, V3_stride1, 0, . ^~~~~~~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpf6wtnpmc/mod.cpp:565:9: note: insert an explicit cast to silence this issue. V3_stride0, V3_stride1, 0, . ^~~~~~~~~~. static_cast<int>( ). /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpf6wtnpmc/mod.cpp:565:21: error: non-constant-expression cannot be narrowed from type 'ssize_t' (aka 'long') to 'int' in initializer list [-Wc++11-narrowing]. V3_stride0, V3_stride1, 0, . ^~~~~~~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpf6wtnpmc/mod.cpp:565:21: note: insert an explicit cast to silence this issue. V3_stride0, V3_stride1, 0, . ^~~~~~~~~~. static_cast<int>( ). /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpf6wtnpmc/mod.cpp:566:4: error: non-constant-expression cannot be narrowed from type 'ssize_t' (aka 'long') to 'int' in initializer list [-Wc++11-narrowing]. 0, V5_stride1, V5_stride2, . ^~~~~~~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpf6wtnpmc/mod.cpp:566:4: note: insert an explicit cast to silence this issue. 0, V5_stride1, V5_stride2, . ^~~~~~~~~~. static_cast<int>( ). /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpf6wtnpmc/mod.cpp:566:16: error: non-constant-expression cannot be narrowed from type 'ssize_t' (aka 'long') to 'int' in initializer list [-Wc++11-narrowing]. 0, V5_stride1, V5_stride2, . ^~~~~~~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpf6wtnpmc/mod.cpp:566:16: note: insert an explicit cast to silence this issue. 0, V5_stride1, V5_stride2, . ^~~~~~~~~~. static_cast<int>( ). /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpf6wtnpmc/mod.cpp:567:1: error: non-constant-expression cannot be narrowed from type 'ssize_t' (aka 'long') to 'int' in initializer list [-Wc++11-narrowing]. V1_stride0, V1_stride1, V1_stride2. ^~~~~~~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpf6wtnpmc/mod.cpp:567:1: note: insert an explicit cast to silence this issue. V1_stride0, V1_stride1, V1_stride2. ^~~~~~~~~~. static_cast<int>( ). /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpf6wtnpmc/mod.cpp:567:13: error: non-constant-expression cannot be narrowed from type 'ssize_t' (aka 'long') to 'int' in initializer list [-Wc++11-narrowing]. V1_stride0, V1_stride1, V1_stride2. ^~~~~~~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpf6wtnpmc/mod.cpp:567:13: note: insert an explicit cast to silence this issue. V1_stride0, V1_stride1, V1_stride2. ^~~~~~~~~~. static_cast<int>( ). /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpf6wtnpmc/mod.cpp:567:25: error: non-constant-expression cannot be narrowed from type 'ssize_t' (aka 'long') to 'int' in initializer list [-Wc++11-narrowing]. V1_stride0, V1_stride1, V1_stride2. ^~~~~~~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpf6wtnpmc/mod.cpp:567:25: note: insert an explicit cast to silence this issue. V1_stride0, V1_stride1, V1_stride2. ^~~~~~~~~~. static_cast<int>( ). 10 errors generated.. ", '[Elemwise{mul,no_inplace}(<TensorType(float64, (False, False, True))>, <TensorType(float64, (True, False, False))>)]')
Hi Jeremy,
Thanks for trying this out! And my apologies it hasn't been working. The test_models issue is a packaging one, that should be pretty straightforward for me to fix.
The theano issue is a bit odd, I haven't seen that myself. The first try might be to suppress the warning
import theano
theano.config.gcc.cxxflags = "-Wno-c++11-narrowing"
Otherwise this stackoverflow post seems to think its due to me not initializing the shapes correctly.
Hopefully the find_packages command will cause the setup.py script to copy along the test_models directory.
Hi @pstjohn the theano.config.gcc.cxxflags
warning suppression seems to be doing the job.
I have tried it so far on wu2014
and run_hackett_inferency.py
and no compile errors have come up. When I'm finished testing all the notebooks, I can send you a pull request with the changes if you'd like.
Hi Peter,
I created the
idp_new
conda environment following the instructions and installed emll within that environment usingpip install --upgrade .
within the top-levelemll
directory. as an aside, theemll/test_models
directory did not install, so I had to manually copy it to~/.pyenv/versions/miniconda3-latest/envs/idp_new/lib/python3.6/site-packages/emll
I then added
idp_new
to my list of jupyter kernels, and started up jupyter.However, when I tried to run
pymc3
either fromcontador.ipynb
orhackett.ipynb
, I got the following error:For
contador.ipynb
, the error was:and likewise for
hackett.ipynb
it was:Also, in order to run
hackett.ipynb
, I had to remove the~/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/lock_dir
directory.Please advise,
Jeremy