lu-group / deeponet-fno

DeepONet & FNO (with practical extensions)
Other
202 stars 41 forks source link

Getting Issues while running the deeponet on Darcy_rectangular_pwc #19

Open SDU-HV-Plasma opened 1 month ago

SDU-HV-Plasma commented 1 month ago

I am trying to run the code on Darcy_rectangular_pwc and getting following error. Please look into it. Thanks

code:

branch = tf.keras.Sequential(
        [
            tf.keras.layers.InputLayer(input_shape=(m,)),
            tf.keras.layers.Reshape((29, 29, 1)),
            tf.keras.layers.Conv2D(64, (5, 5), strides=2, activation=activation),
            tf.keras.layers.Conv2D(128, (5, 5), strides=2, activation=activation),
            tf.keras.layers.Flatten(),
            tf.keras.layers.Dense(128, activation=activation),
            tf.keras.layers.Dense(128),
        ]
    )
    branch.summary()
    net = dde.maps.DeepONetCartesianProd(
        [m, branch], [2, 128, 128, 128, 128], activation, "Glorot normal"
    )

error:

in SingleOutputStrategy.build(self, layer_sizes_branch, layer_sizes_trunk)
     29 def build(self, layer_sizes_branch, layer_sizes_trunk):
     30     if layer_sizes_branch[-1] != layer_sizes_trunk[-1]:
---> 31         raise AssertionError(
     32             "Output sizes of branch net and trunk net do not match."
     33         )
     34     branch = self.net.build_branch_net(layer_sizes_branch)
     35     trunk = self.net.build_trunk_net(layer_sizes_trunk)
AssertionError: Output sizes of branch net and trunk net do not match.**
lululxvi commented 2 weeks ago

Bug fixed. Please use the latest version from GitHub.