Open FedericoCampe8 opened 3 years ago
可能因为它把第一个参数当成了name,而它实际上是shape
更改为下面的代码:
self.U = self.add_weight(name='U',
shape=(n_classes, n_classes),
initializer=self.init,
regularizer=self.U_regularizer,
constraint=self.U_constraint)
或者你看另一个人提出的问题,里面作者给出了另外一个ChainCRF.py文件,替换原来的就可以了
Running the code "as-is" I see
/content/ChainCRF.py in build(self, input_shape) 302 name='U', 303 regularizer=self.U_regularizer, --> 304 constraint=self.U_constraint) 305 306 self.b_start = self.add_weight((n_classes, ),
TypeError: add_weight() got multiple values for argument 'name'
Is the code maintained?