问题:
如:
from keras import backend as K
varib = K.variable(0.)
new_value = np.min([0.1, 1.0])
varib.set_value(new_value)
报错:
AttributeError: 'Variable' object has no attribute 'set_value'
解决办法:
from keras import backend as K
K.set_value(self.kl_weight, new_value)