Thanks Sushree for the response!
I changed the Keras version and found the topology module under dist-package. I need to import Network from topology but it shows an error. Provided use used Network() in the later section of the code.
ImportError: cannot import name ‘Network’ from ‘keras.engine.topology’ (/usr/local/lib/python3.7/dist-packages/keras/engine/topology.py)