BethanyL / DeepKoopman

neural networks to learn Koopman eigenfunctions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"ValueError: Cannot take the length of Shape with unknown rank"

LenCewa opened this issue · comments

commented

Hello,
when I ran the code the error "ValueError: Cannot take the length of Shape with unknown rank" occurred. When I remove the if-clause in networkarch.py (line 373 to 445):

    if len(ycoords.shape) == 1:
        ycoords = ycoords[:, np.newaxis]

    if ycoords.shape[1] == 2:
        # complex conjugate pair
        input = tf.reduce_sum(tf.square(ycoords), axis=1, keep_dims=True)

    else:
        input = ycoords

the problem disappeared. But then I had to manually try how input and/or ycoords should be set for each system. It seems that people are working on this type of error.

Thanks! I hadn't tested this code with newer TensorFlow