error call() missing required positional arguments : shape()

Viewed 34

I am trying to run one code that is written on tensorflow 1 on tensorflow 2.

The original code is at https://paperswithcode.com/paper/physics-informed-deep-learning-for/review/

I tried to adapt the code with tensorflow 2 but I receive this error which leads to this part and the last line.

def xavier_init(self, size):
    in_dim = size[0]
    out_dim = size[1]
    xavier_stddev = np.sqrt(2 / (in_dim + out_dim))
    return tf.compat.v1.Variable(tf.compat.v1.keras.initializers.TruncatedNormal([in_dim, out_dim], stddev=xavier_stddev), dtype=tf.dtypes.float32)

It seems the command variable needs to define the shape! Can anyone help me with this?

0 Answers
Related