IndicoDataSolutions / Passage

A little library for text analysis with RNNs.
MIT License
531 stars 134 forks source link

Error while building RNN model #27

Closed naeemulhassan closed 9 years ago

naeemulhassan commented 9 years ago

model = RNN(layers=layers, cost='CategoricalCrossEntropy')

I received this error while building the RNN model. Any ideas? The complete error message is very long.

Thanks!

/home/naeemul/anaconda/lib/python2.7/site-packages/theano/tensor/subtensor.py:110: FutureWarning: comparison to None will result in an elementwise object comparison in the future. start in [None, 0] or /home/naeemul/anaconda/lib/python2.7/site-packages/theano/tensor/subtensor.py:114: FutureWarning: comparison to None will result in an elementwise object comparison in the future. stop in [None, length, maxsize] or /home/naeemul/anaconda/lib/python2.7/site-packages/theano/tensor/opt.py:2165: FutureWarning: comparison to None will result in an elementwise object comparison in the future. if (replace_x == replace_y and WARNING (theano.tensor.blas): We did not found a dynamic library into the library_dir of the library we use for blas. If you use ATLAS, make sure to compile it with dynamics library.

WARNING:theano.tensor.blas:We did not found a dynamic library into the library_dir of the library we use for blas. If you use ATLAS, make sure to compile it with dynamics library.

/usr/bin/ld: cannot find -lf77blas /usr/bin/ld: cannot find -lcblas /usr/bin/ld: cannot find -latlas collect2: error: ld returned 1 exit status


Exception Traceback (most recent call last)

in () ----> 1 model = RNN(layers=layers, cost='CategoricalCrossEntropy') 2 model.fit(train_tokens, train.verdict) 3 4 model.predict(tokenizer.transform(test.text)) /home/naeemul/anaconda/lib/python2.7/site-packages/passage/models.pyc in **init**(self, layers, cost, updater, verbose, Y, iterator) 49 self.updates = self.updater.get_updates(self.params, cost) 50 ---> 51 self._train = theano.function([self.X, self.Y], cost, updates=self.updates) 52 self._cost = theano.function([self.X, self.Y], cost) 53 self._predict = theano.function([self.X], self.y_te) /home/naeemul/anaconda/lib/python2.7/site-packages/theano/compile/function.pyc in function(inputs, outputs, mode, updates, givens, no_default_updates, accept_inplace, name, rebuild_strict, allow_input_downcast, profile, on_unused_input) 221 allow_input_downcast=allow_input_downcast, 222 on_unused_input=on_unused_input, --> 223 profile=profile) 224 # We need to add the flag check_aliased inputs if we have any mutable or 225 # borrowed used defined inputs /home/naeemul/anaconda/lib/python2.7/site-packages/theano/compile/pfunc.pyc in pfunc(params, outputs, mode, updates, givens, no_default_updates, accept_inplace, name, rebuild_strict, allow_input_downcast, profile, on_unused_input) 510 return orig_function(inputs, cloned_outputs, mode, 511 accept_inplace=accept_inplace, name=name, profile=profile, --> 512 on_unused_input=on_unused_input) 513 514 /home/naeemul/anaconda/lib/python2.7/site-packages/theano/compile/function_module.pyc in orig_function(inputs, outputs, mode, accept_inplace, name, profile, on_unused_input) 1310 profile=profile, 1311 on_unused_input=on_unused_input).create( -> 1312 defaults) 1313 1314 t2 = time.time() /home/naeemul/anaconda/lib/python2.7/site-packages/theano/compile/function_module.pyc in create(self, input_storage, trustme) 1179 # Get a function instance 1180 start_linker = time.time() -> 1181 _fn, _i, _o = self.linker.make_thunk(input_storage=input_storage_lists) 1182 end_linker = time.time() 1183 /home/naeemul/anaconda/lib/python2.7/site-packages/theano/gof/link.pyc in make_thunk(self, profiler, input_storage, output_storage) 432 return self.make_all(profiler=profiler, 433 input_storage=input_storage, --> 434 output_storage=output_storage)[:3] 435 436 def make_all(self, profiler, input_storage, output_storage): /home/naeemul/anaconda/lib/python2.7/site-packages/theano/gof/vm.pyc in make_all(self, profiler, input_storage, output_storage) 845 storage_map, 846 compute_map, --> 847 no_recycling)) 848 except Exception, e: 849 e.args = ("The following error happened while" /home/naeemul/anaconda/lib/python2.7/site-packages/theano/gof/op.pyc in make_thunk(self, node, storage_map, compute_map, no_recycling) 604 logger.debug('Trying CLinker.make_thunk') 605 outputs = cl.make_thunk(input_storage=node_input_storage, --> 606 output_storage=node_output_storage) 607 fill_storage, node_input_filters, node_output_filters = outputs 608 /home/naeemul/anaconda/lib/python2.7/site-packages/theano/gof/cc.pyc in make_thunk(self, input_storage, output_storage, keep_lock) 946 cthunk, in_storage, out_storage, error_storage = self.**compile**( 947 input_storage, output_storage, --> 948 keep_lock=keep_lock) 949 950 res = _CThunk(cthunk, init_tasks, tasks, error_storage) /home/naeemul/anaconda/lib/python2.7/site-packages/theano/gof/cc.pyc in **compile**(self, input_storage, output_storage, keep_lock) 889 input_storage, 890 output_storage, --> 891 keep_lock=keep_lock) 892 return (thunk, 893 [link.Container(input, storage) for input, storage in /home/naeemul/anaconda/lib/python2.7/site-packages/theano/gof/cc.pyc in cthunk_factory(self, error_storage, in_storage, out_storage, keep_lock) 1320 else: 1321 module = get_module_cache().module_from_key( -> 1322 key=key, fn=self.compile_cmodule_by_step, keep_lock=keep_lock) 1323 1324 vars = self.inputs + self.outputs + self.orphans /home/naeemul/anaconda/lib/python2.7/site-packages/theano/gof/cmodule.pyc in module_from_key(self, key, fn, keep_lock, key_data) 994 # The module should be returned by the last 995 # step of the compilation. --> 996 module = next(compile_steps) 997 except StopIteration: 998 break /home/naeemul/anaconda/lib/python2.7/site-packages/theano/gof/cc.pyc in compile_cmodule_by_step(self, location) 1235 lib_dirs=self.lib_dirs(), 1236 libs=libs, -> 1237 preargs=preargs) 1238 except Exception, e: 1239 e.args += (str(self.fgraph),) /home/naeemul/anaconda/lib/python2.7/site-packages/theano/gof/cmodule.pyc in compile_str(module_name, src_code, location, include_dirs, lib_dirs, libs, preargs, py_module) 1969 # difficult to read. 1970 raise Exception('Compilation failed (return status=%s): %s' % -> 1971 (status, compile_stderr.replace('\n', '. '))) 1972 elif config.cmodule.compilation_warning and compile_stderr: 1973 # Print errors just below the command line. Exception: ('The following error happened while compiling the node', Dot22(Reshape{2}.0, Reshape{2}.0), '\n', 'Compilation failed (return status=1): /usr/bin/ld: cannot find -lf77blas. /usr/bin/ld: cannot find -lcblas. /usr/bin/ld: cannot find -latlas. collect2: error: ld returned 1 exit status. ', '[Dot22(, )]')
Newmu commented 9 years ago

This is related to improper configuration/installation of theano. An example of a correct way to install theano is here http://deeplearning.net/software/theano/install_ubuntu.html

More specifically, it looks like you BLAS is improperly configured/linked - the openblas example in the above link should help with setting up a proper BLAS.

Closing as this is not related to Passage but is instead a system setup issue with other libraries.