bojone / keras_lookahead

lookahead optimizer for keras
170 stars 31 forks source link

Not working when using libraries from tensorflow.keras... #8

Open IlyaMichlin opened 5 years ago

IlyaMichlin commented 5 years ago
 29                       model._feed_targets +
 30                       model._feed_sample_weights)

---> 31 if model._uses_dynamic_learning_phase(): 32 inputs += [K.learning_phase()] 33 fast_params = model._collected_trainable_weights

AttributeError: 'Sequential' object has no attribute '_uses_dynamic_learning_phase'

gptcod commented 5 years ago

I also encounter this problem.

mkhlyzov commented 5 years ago

I also encounter this problem.

I guess you won't see a solution in the nearest future, keras_lookahead seems to be pure keras implementation https://github.com/bojone/keras_lookahead/issues/6

wenfan-wenfan commented 4 years ago

@IlyaMichlin @herosunly @fzyzcjy This may be due to a keras version mismatch, which I have also experienced. You can solve the problem in this way: " pip install keras==2.2.4 " ;