From tensorflow.keras.backend import function in TensorFlow v.2.16

Hi,
Question
I’m new to TensorFlow and am trying to deploy the model trained by another lab. They used TensorFlow v.2.8 but, to have TensorFlow running on my MacBook (M1 chip), I installed v.2.16 in the virtual environment. This difference in TensorFlow version gave me an issue as they have a line: from tensorflow.keras.backend import function that keeps giving me import error.

What I tried

  1. I tried to install v. 2.8 on Macbook but the kernel in Jupyter notebook keeps crashing and restarting.
  2. I tried to find the equivalent function in v.2.16 but cannot find it.

I wonder if there is a way for me to 1) either run v.2.8 on M1 Mac or 2) resolve the import issue when running from tensorflow.keras.backend import function

Thank you very much for helping

“Modified by moderator”