The error occurs because network_1 and network_2 are not yet built. In keras, layers in a sequential model are not instantiated until the model is called on some input data. when you try to access the .output attribute of a sequential model you need to build or called it manually before accessing it. Please refer to this gist.