pstjohn / emll

some code for linlog model simulation
GNU General Public License v2.0
9 stars 6 forks source link

theano fails to compile #2

Open djinnome opened 5 years ago

djinnome commented 5 years ago

Hi Peter,

I created the idp_new conda environment following the instructions and installed emll within that environment using pip install --upgrade . within the top-level emll directory. as an aside, the emll/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 from contador.ipynb or hackett.ipynb, I got the following error:

For contador.ipynb, the error was:


You can find the C code in this temporary file: /var/folders/z1/nhct2gps3y94tkbwqvvd7y_jw6p1l8/T/theano_compilation_error_raygjexd
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
<ipython-input-8-131db2f01cd9> in <module>
     10         r_compartments=r_compartments
     11     ))
---> 12     Ey_t = T.zeros_like(ll.Ey, dtype='float32')
     13 
     14 with pymc_model:

~/.pyenv/versions/miniconda3-latest/envs/idp_new/lib/python3.6/site-packages/theano/tensor/basic.py in zeros_like(model, dtype, opt)
   2526     if opt and ret.type == model.type:
   2527         return ret
-> 2528     return fill(model, ret)
   2529 
   2530 

~/.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/tmpukuj7u14/mod.cpp:510: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[2] = {V3_n0, V3_n1};.                           ^~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpukuj7u14/mod.cpp:510:27: note: insert an explicit cast to silence this issue.     int init_totals[2] = {V3_n0, V3_n1};.                           ^~~~~.                           static_cast<int>( ). /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpukuj7u14/mod.cpp:510: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[2] = {V3_n0, V3_n1};.                                  ^~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpukuj7u14/mod.cpp:510:34: note: insert an explicit cast to silence this issue.     int init_totals[2] = {V3_n0, V3_n1};.                                  ^~~~~.                                  static_cast<int>( ). /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpukuj7u14/mod.cpp:522: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, .         ^~~~~~~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpukuj7u14/mod.cpp:522:9: note: insert an explicit cast to silence this issue.         V3_stride0, V3_stride1, .         ^~~~~~~~~~.         static_cast<int>( ). /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpukuj7u14/mod.cpp:522: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, .                     ^~~~~~~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpukuj7u14/mod.cpp:522:21: note: insert an explicit cast to silence this issue.         V3_stride0, V3_stride1, .                     ^~~~~~~~~~.                     static_cast<int>( ). /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpukuj7u14/mod.cpp:524: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. ^~~~~~~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpukuj7u14/mod.cpp:524:1: note: insert an explicit cast to silence this issue. V1_stride0, V1_stride1. ^~~~~~~~~~. static_cast<int>( ). /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpukuj7u14/mod.cpp:524: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.             ^~~~~~~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmpukuj7u14/mod.cpp:524:13: note: insert an explicit cast to silence this issue. V1_stride0, V1_stride1.             ^~~~~~~~~~.             static_cast<int>( ). 6 errors generated.. ", '[Elemwise{second,no_inplace}(TensorConstant{[]}, <TensorType(float32, (True, True))>)]')

and likewise for hackett.ipynb it was:

You can find the C code in this temporary file: /var/folders/z1/nhct2gps3y94tkbwqvvd7y_jw6p1l8/T/theano_compilation_error_29s7fvtp
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
<ipython-input-5-fca5140ff951> in <module>
----> 1 from run_hackett_inference import *

~/Projects/DL/emll/notebooks/run_hackett_inference.py in <module>
    111 
    112     e_measured = pm.Normal('log_e_measured', mu=np.log(en), sd=0.2,
--> 113                            shape=(n_exp, len(e_inds)))
    114     e_unmeasured = pm.Laplace('log_e_unmeasured', mu=0, b=0.1,
    115                               shape=(n_exp, len(e_laplace_inds)))

~/.pyenv/versions/miniconda3-latest/envs/idp_new/lib/python3.6/site-packages/pymc3/distributions/distribution.py in __new__(cls, name, *args, **kwargs)
     40             total_size = kwargs.pop('total_size', None)
     41             dist = cls.dist(*args, **kwargs)
---> 42             return model.Var(name, dist, data, total_size)
     43         else:
     44             raise TypeError("Name needs to be a string but got: {}".format(name))

~/.pyenv/versions/miniconda3-latest/envs/idp_new/lib/python3.6/site-packages/pymc3/model.py in Var(self, name, dist, data, total_size)
    806                 with self:
    807                     var = FreeRV(name=name, distribution=dist,
--> 808                                  total_size=total_size, model=self)
    809                 self.free_RVs.append(var)
    810             else:

~/.pyenv/versions/miniconda3-latest/envs/idp_new/lib/python3.6/site-packages/pymc3/model.py in __init__(self, type, owner, index, name, distribution, total_size, model)
   1206             self.tag.test_value = np.ones(
   1207                 distribution.shape, distribution.dtype) * distribution.default()
-> 1208             self.logp_elemwiset = distribution.logp(self)
   1209             # The logp might need scaling in minibatches.
   1210             # This is done in `Factor`.

~/.pyenv/versions/miniconda3-latest/envs/idp_new/lib/python3.6/site-packages/pymc3/distributions/continuous.py in logp(self, value)
    445         mu = self.mu
    446 
--> 447         return bound((-tau * (value - mu)**2 + tt.log(tau / np.pi / 2.)) / 2.,
    448                      sd > 0)
    449 

~/.pyenv/versions/miniconda3-latest/envs/idp_new/lib/python3.6/site-packages/theano/tensor/var.py in __sub__(self, other)
    145         # and the return value in that case
    146         try:
--> 147             return theano.tensor.basic.sub(self, other)
    148         except (NotImplementedError, AsTensorError):
    149             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/tmp3hxg0vw8/mod.cpp:572: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[2] = {V3_n0, V3_n1};.                           ^~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmp3hxg0vw8/mod.cpp:572:27: note: insert an explicit cast to silence this issue.     int init_totals[2] = {V3_n0, V3_n1};.                           ^~~~~.                           static_cast<int>( ). /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmp3hxg0vw8/mod.cpp:572: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[2] = {V3_n0, V3_n1};.                                  ^~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmp3hxg0vw8/mod.cpp:572:34: note: insert an explicit cast to silence this issue.     int init_totals[2] = {V3_n0, V3_n1};.                                  ^~~~~.                                  static_cast<int>( ). /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmp3hxg0vw8/mod.cpp:584: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, .         ^~~~~~~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmp3hxg0vw8/mod.cpp:584:9: note: insert an explicit cast to silence this issue.         V3_stride0, V3_stride1, .         ^~~~~~~~~~.         static_cast<int>( ). /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmp3hxg0vw8/mod.cpp:584: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, .                     ^~~~~~~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmp3hxg0vw8/mod.cpp:584:21: note: insert an explicit cast to silence this issue.         V3_stride0, V3_stride1, .                     ^~~~~~~~~~.                     static_cast<int>( ). /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmp3hxg0vw8/mod.cpp:585:1: error: non-constant-expression cannot be narrowed from type 'ssize_t' (aka 'long') to 'int' in initializer list [-Wc++11-narrowing]. V5_stride0, V5_stride1, . ^~~~~~~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmp3hxg0vw8/mod.cpp:585:1: note: insert an explicit cast to silence this issue. V5_stride0, V5_stride1, . ^~~~~~~~~~. static_cast<int>( ). /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmp3hxg0vw8/mod.cpp:585:13: error: non-constant-expression cannot be narrowed from type 'ssize_t' (aka 'long') to 'int' in initializer list [-Wc++11-narrowing]. V5_stride0, V5_stride1, .             ^~~~~~~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmp3hxg0vw8/mod.cpp:585:13: note: insert an explicit cast to silence this issue. V5_stride0, V5_stride1, .             ^~~~~~~~~~.             static_cast<int>( ). /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmp3hxg0vw8/mod.cpp:586: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. ^~~~~~~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmp3hxg0vw8/mod.cpp:586:1: note: insert an explicit cast to silence this issue. V1_stride0, V1_stride1. ^~~~~~~~~~. static_cast<int>( ). /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmp3hxg0vw8/mod.cpp:586: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.             ^~~~~~~~~~. /Users/zuck016/.theano/compiledir_Darwin-16.7.0-x86_64-i386-64bit-i386-3.6.7-64/tmp3hxg0vw8/mod.cpp:586:13: note: insert an explicit cast to silence this issue. V1_stride0, V1_stride1.             ^~~~~~~~~~.             static_cast<int>( ). 8 errors generated.. ", '[Elemwise{sub,no_inplace}(log_e_measured, TensorConstant{[[ 0.24440..61982882]]})]')

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

djinnome commented 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))>)]')
pstjohn commented 5 years ago

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.

pstjohn commented 5 years ago

Hopefully the find_packages command will cause the setup.py script to copy along the test_models directory.

djinnome commented 5 years ago

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.