For some reason the 2.13.1 that works for others was giving trouble here.
I tried 2.8.0 but that gave an issue that stack overflow said is fixed on 2.9.0.
Upgrading to 2.9.0 works up until the last step, at which K.gradients() fail because of eager execution (which is on by default on this later version).
With 2.9.0 and eager execution disabled, it all runs through successfully.
#!pip install keras=='2.3.1'
!pip install keras=='2.9.0'
import numpy as np
import keras.backend as K
# need to add these
import tensorflow as tf
tf.compat.v1.disable_eager_execution()
For some reason the 2.13.1 that works for others was giving trouble here.
I tried 2.8.0 but that gave an issue that stack overflow said is fixed on 2.9.0.
Upgrading to 2.9.0 works up until the last step, at which
K.gradients()fail because of eager execution (which is on by default on this later version).With 2.9.0 and eager execution disabled, it all runs through successfully.