---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
<ipython-input-69-0d922b3be50f> in <module>()
10
11 sgd = SGD(lr=0.1, decay=1e-6, momentum=0.9, nesterov=True)
---> 12 model.compile(loss='mean_squared_error', optimizer=sgd)
/Users/joshuafass/anaconda/envs/py27/lib/python2.7/site-packages/Keras-0.1.2-py2.7.egg/keras/models.pyc in compile(self, optimizer, loss, class_mode, theano_mode)
404 allow_input_downcast=True, mode=theano_mode)
405 self._train_with_acc = theano.function(train_ins, [train_loss, train_accuracy], updates=updates,
--> 406 allow_input_downcast=True, mode=theano_mode)
407 self._predict = theano.function(predict_ins, self.y_test,
408 allow_input_downcast=True, mode=theano_mode)
/Users/joshuafass/anaconda/envs/py27/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)
264 allow_input_downcast=allow_input_downcast,
265 on_unused_input=on_unused_input,
--> 266 profile=profile)
267 # We need to add the flag check_aliased inputs if we have any mutable or
268 # borrowed used defined inputs
/Users/joshuafass/anaconda/envs/py27/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)
509 return orig_function(inputs, cloned_outputs, mode,
510 accept_inplace=accept_inplace, name=name, profile=profile,
--> 511 on_unused_input=on_unused_input)
512
513
/Users/joshuafass/anaconda/envs/py27/lib/python2.7/site-packages/theano/compile/function_module.pyc in orig_function(inputs, outputs, mode, accept_inplace, name, profile, on_unused_input)
1463 accept_inplace=accept_inplace,
1464 profile=profile,
-> 1465 on_unused_input=on_unused_input).create(
1466 defaults)
1467
/Users/joshuafass/anaconda/envs/py27/lib/python2.7/site-packages/theano/compile/function_module.pyc in __init__(self, inputs, outputs, mode, accept_inplace, function_builder, profile, on_unused_input, fgraph)
1158 optimizer, inputs, outputs)
1159 else:
-> 1160 optimizer_profile = optimizer(fgraph)
1161
1162 end_optimizer = time.time()
/Users/joshuafass/anaconda/envs/py27/lib/python2.7/site-packages/theano/gof/opt.pyc in __call__(self, fgraph)
88 Same as self.optimize(fgraph)
89 """
---> 90 return self.optimize(fgraph)
91
92 def add_requirements(self, fgraph):
/Users/joshuafass/anaconda/envs/py27/lib/python2.7/site-packages/theano/gof/opt.pyc in optimize(self, fgraph, *args, **kwargs)
79 orig = theano.tensor.basic.constant.enable
80 theano.tensor.basic.constant.enable = False
---> 81 ret = self.apply(fgraph, *args, **kwargs)
82 finally:
83 theano.tensor.basic.constant.enable = orig
/Users/joshuafass/anaconda/envs/py27/lib/python2.7/site-packages/theano/gof/opt.pyc in apply(self, fgraph)
193 try:
194 t0 = time.time()
--> 195 sub_prof = optimizer.optimize(fgraph)
196 l.append(float(time.time() - t0))
197 sub_profs.append(sub_prof)
/Users/joshuafass/anaconda/envs/py27/lib/python2.7/site-packages/theano/gof/opt.pyc in optimize(self, fgraph, *args, **kwargs)
79 orig = theano.tensor.basic.constant.enable
80 theano.tensor.basic.constant.enable = False
---> 81 ret = self.apply(fgraph, *args, **kwargs)
82 finally:
83 theano.tensor.basic.constant.enable = orig
/Users/joshuafass/anaconda/envs/py27/lib/python2.7/site-packages/theano/gof/opt.pyc in apply(self, fgraph, start_from)
1835 nb = change_tracker.nb_imported
1836 t_opt = time.time()
-> 1837 lopt_change = self.process_node(fgraph, node, lopt)
1838 time_opts[lopt] += time.time() - t_opt
1839 if lopt_change:
/Users/joshuafass/anaconda/envs/py27/lib/python2.7/site-packages/theano/gof/opt.pyc in process_node(self, fgraph, node, lopt)
1525 return False
1526 try:
-> 1527 fgraph.replace_all_validate(repl_pairs, reason=lopt)
1528 return True
1529 except Exception, e:
/Users/joshuafass/anaconda/envs/py27/lib/python2.7/site-packages/theano/gof/toolbox.pyc in replace_all_validate(self, fgraph, replacements, reason, verbose)
257 for r, new_r in replacements:
258 try:
--> 259 fgraph.replace(r, new_r, reason=reason, verbose=False)
260 except Exception, e:
261 if ('The type of the replacement must be the same' not in
/Users/joshuafass/anaconda/envs/py27/lib/python2.7/site-packages/theano/gof/fg.pyc in replace(self, r, new_r, reason, verbose)
500 for node, i in list(r.clients): # copy the client list for iteration
501 assert (node == 'output' and self.outputs[i] is r) or (node.inputs[i] is r)
--> 502 self.change_input(node, i, new_r, reason=reason)
503
504 # sometimes the following is triggered. If you understand why, please explain to James.
/Users/joshuafass/anaconda/envs/py27/lib/python2.7/site-packages/theano/gof/fg.pyc in change_input(self, node, i, new_r, reason)
440 return
441
--> 442 self.__import_r__([new_r], reason=reason)
443 self.__add_clients__(new_r, [(node, i)])
444 prune = self.__remove_clients__(r, [(node, i)], False)
/Users/joshuafass/anaconda/envs/py27/lib/python2.7/site-packages/theano/gof/fg.pyc in __import_r__(self, variables, reason)
255 for apply_node in [r.owner for r in variables if r.owner is not None]:
256 if apply_node not in self.apply_nodes:
--> 257 self.__import__(apply_node, reason=reason)
258 for r in variables:
259 if r.owner is None and not isinstance(r, graph.Constant) and r not in self.inputs:
/Users/joshuafass/anaconda/envs/py27/lib/python2.7/site-packages/theano/gof/fg.pyc in __import__(self, apply_node, check, reason)
375 self.__add_clients__(input, [(node, i)])
376 assert node.fgraph is self
--> 377 self.execute_callbacks('on_import', node, reason)
378
379 ### prune ###
/Users/joshuafass/anaconda/envs/py27/lib/python2.7/site-packages/theano/gof/fg.pyc in execute_callbacks(self, name, *args, **kwargs)
575 continue
576 tf0 = time.time()
--> 577 fn(self, *args, **kwargs)
578 self.execute_callbacks_times[feature] += time.time() - tf0
579 self.execute_callbacks_time += time.time() - t0
/Users/joshuafass/anaconda/envs/py27/lib/python2.7/site-packages/theano/tensor/opt.pyc in on_import(self, fgraph, node, reason)
1045 try:
1046 o_shapes = shape_infer(node,
-> 1047 [self.shape_of[r] for r in node.inputs])
1048 except ShapeError:
1049 o_shapes = self.default_infer_shape(node, [self.shape_of[r] for
/Users/joshuafass/anaconda/envs/py27/lib/python2.7/site-packages/theano/tensor/subtensor.pyc in infer_shape(self, node, shapes)
532 outshp.append(xl)
533 else:
--> 534 cnf = get_canonical_form_slice(idx, xl)[0]
535 if cnf.step == 1:
536 length = cnf.stop - cnf.start
/Users/joshuafass/anaconda/envs/py27/lib/python2.7/site-packages/theano/tensor/subtensor.pyc in get_canonical_form_slice(theslice, length)
124
125 start, is_start_constant = analyze(theslice.start)
--> 126 stop, is_stop_constant = analyze(theslice.stop)
127 step, is_step_constant = analyze(theslice.step)
128 length, is_length_constant = analyze(length)
/Users/joshuafass/anaconda/envs/py27/lib/python2.7/site-packages/theano/tensor/subtensor.pyc in analyze(x)
116 def analyze(x):
117 try:
--> 118 x_constant = get_scalar_constant_value(x)
119 is_constant = True
120 except theano.tensor.NotScalarConstantError:
/Users/joshuafass/anaconda/envs/py27/lib/python2.7/site-packages/theano/tensor/basic.pyc in get_scalar_constant_value(orig_v, elemwise, only_process_constants)
588 v = v.owner.inputs[0]
589 continue
--> 590 elif isinstance(v.owner.op, theano.compile.ops.Shape_i):
591 if isinstance(v.owner.inputs[0], Constant):
592 return numpy.asarray(v.owner.inputs[0].data.shape[v.owner.op.i])
KeyboardInterrupt: