Open wllps1988315 opened 8 years ago
When I run the Semantic-Relatedness task import eval_sick eval_sick.evaluate(model, evaltest=True)
Errors: In [7]: import eval_sick Using Theano backend.
In [8]: eval_sick.evaluate(model, evaltest=True) Preparing data... Computing training skipthoughts... Computing development skipthoughts... Computing feature combinations... Encoding labels...
Compiling model...
AttributeError Traceback (most recent call last) in () ----> 1 eval_sick.evaluate(model, evaltest=True)
/data/skip-thoughts/eval_sick.pyc in evaluate(model, seed, evaltest) 40 41 print 'Compiling model...' ---> 42 lrmodel = prepare_model(ninputs=trainF.shape[1]) 43 44 print 'Training...'
/data/skip-thoughts/eval_sick.pyc in prepare_model(ninputs, nclass) 73 lrmodel.add(Dense(ninputs, nclass)) 74 lrmodel.add(Activation('softmax')) ---> 75 lrmodel.compile(loss='categorical_crossentropy', optimizer='adam') 76 return lrmodel 77
/usr/lib/python2.7/site-packages/Keras-0.3.1-py2.7.egg/keras/models.pyc in compile(self, optimizer, loss, class_mode) 433 self.X_test = self.get_input(train=False) 434 --> 435 self.y_train = self.get_output(train=True) 436 self.y_test = self.get_output(train=False) 437
/usr/lib/python2.7/site-packages/Keras-0.3.1-py2.7.egg/keras/layers/containers.pyc in get_output(self, train) 126 127 def get_output(self, train=False): --> 128 return self.layers[-1].get_output(train) 129 130 def set_input(self):
/usr/lib/python2.7/site-packages/Keras-0.3.1-py2.7.egg/keras/layers/core.pyc in get_output(self, train) 669 670 def get_output(self, train=False): --> 671 X = self.get_input(train) 672 return self.activation(X) 673
/usr/lib/python2.7/site-packages/Keras-0.3.1-py2.7.egg/keras/layers/core.pyc in get_input(self, train) 171 if previous_layer_id in self.layer_cache: 172 return self.layer_cache[previous_layer_id] --> 173 previous_output = self.previous.get_output(train=train) 174 if hasattr(self, 'layer_cache') and self.cache_enabled: 175 previous_layerid = '%s%s' % (id(self.previous), train)
/usr/lib/python2.7/site-packages/Keras-0.3.1-py2.7.egg/keras/layers/core.pyc in get_output(self, train) 961 def get_output(self, train=False): 962 X = self.get_input(train) --> 963 output = self.activation(K.dot(X, self.W) + self.b) 964 return output 965
AttributeError: 'Dense' object has no attribute 'W'
any updates?
When I run the Semantic-Relatedness task import eval_sick eval_sick.evaluate(model, evaltest=True)
Errors: In [7]: import eval_sick Using Theano backend.
In [8]: eval_sick.evaluate(model, evaltest=True) Preparing data... Computing training skipthoughts... Computing development skipthoughts... Computing feature combinations... Encoding labels...
Compiling model...
AttributeError Traceback (most recent call last) in () ----> 1 eval_sick.evaluate(model, evaltest=True)
/data/skip-thoughts/eval_sick.pyc in evaluate(model, seed, evaltest) 40 41 print 'Compiling model...' ---> 42 lrmodel = prepare_model(ninputs=trainF.shape[1]) 43 44 print 'Training...'
/data/skip-thoughts/eval_sick.pyc in prepare_model(ninputs, nclass) 73 lrmodel.add(Dense(ninputs, nclass)) 74 lrmodel.add(Activation('softmax')) ---> 75 lrmodel.compile(loss='categorical_crossentropy', optimizer='adam') 76 return lrmodel 77
/usr/lib/python2.7/site-packages/Keras-0.3.1-py2.7.egg/keras/models.pyc in compile(self, optimizer, loss, class_mode) 433 self.X_test = self.get_input(train=False) 434 --> 435 self.y_train = self.get_output(train=True) 436 self.y_test = self.get_output(train=False) 437
/usr/lib/python2.7/site-packages/Keras-0.3.1-py2.7.egg/keras/layers/containers.pyc in get_output(self, train) 126 127 def get_output(self, train=False): --> 128 return self.layers[-1].get_output(train) 129 130 def set_input(self):
/usr/lib/python2.7/site-packages/Keras-0.3.1-py2.7.egg/keras/layers/core.pyc in get_output(self, train) 669 670 def get_output(self, train=False): --> 671 X = self.get_input(train) 672 return self.activation(X) 673
/usr/lib/python2.7/site-packages/Keras-0.3.1-py2.7.egg/keras/layers/core.pyc in get_input(self, train) 171 if previous_layer_id in self.layer_cache: 172 return self.layer_cache[previous_layer_id] --> 173 previous_output = self.previous.get_output(train=train) 174 if hasattr(self, 'layer_cache') and self.cache_enabled: 175 previous_layerid = '%s%s' % (id(self.previous), train)
/usr/lib/python2.7/site-packages/Keras-0.3.1-py2.7.egg/keras/layers/core.pyc in get_output(self, train) 961 def get_output(self, train=False): 962 X = self.get_input(train) --> 963 output = self.activation(K.dot(X, self.W) + self.b) 964 return output 965
AttributeError: 'Dense' object has no attribute 'W'