Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Nanovar crashes with "ValueError: Exception encountered when calling Sequential.call()" #77

Closed
scharf-f opened this issue Mar 20, 2024 · 2 comments

Comments

@scharf-f
Copy link

Dear authors,

I have been using Nanovar for quite a while with an older version (1.3.8) and just now wanted to make an update to 1.6.0 to make use of the new functions you included.

However, I am consistently running in the following error:

[19/03/2024 15:44:58] - Clustering SV breakends - /root/miniconda3/envs/nanovar_1.6.0/lib/python3.11/site-packages/keras/src/layers/core/dense.py:85: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
Traceback (most recent call last):
  File "/root/miniconda3/envs/nanovar_1.6.0/bin/nanovar", line 614, in <module>
    main()
  File "/root/miniconda3/envs/nanovar_1.6.0/bin/nanovar", line 381, in main
    run.cluster_nn2()
  File "/root/miniconda3/envs/nanovar_1.6.0/lib/python3.11/site-packages/nanovar/nv_characterize.py", line 116, in cluster_nn2
    self.out_nn = inference(cluster_out, self.total_out, self.model)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/miniconda3/envs/nanovar_1.6.0/lib/python3.11/site-packages/nanovar/nv_nn.py", line 41, in inference
    predictions = nnmodel.predict(readarray, verbose=0)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/miniconda3/envs/nanovar_1.6.0/lib/python3.11/site-packages/keras/src/utils/traceback_utils.py", line 123, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/root/miniconda3/envs/nanovar_1.6.0/lib/python3.11/site-packages/keras/src/models/functional.py", line 274, in _adjust_input_rank
    raise ValueError(
ValueError: Exception encountered when calling Sequential.call().

^[[1mInvalid input shape for input Tensor("data:0", shape=(32, 23), dtype=float32). Expected shape (None, None, 23), but input has incompatible shape (32, 23)^[[0m

Arguments received by Sequential.call():
  • inputs=tf.Tensor(shape=(32, 23), dtype=float32)
  • training=False
  • mask=None

The last message from the log file is:
[19/03/2024 15:47:18] - WARNING - No training configuration found in the save file, so the model was *not* compiled. Compile it manually.

Do you have any suggestions on how I could solve the issue? Help would be greatly appreciated!

Thank you very much and kind regards,
Flo

@cytham
Copy link
Owner

cytham commented Mar 20, 2024

Hi @scharf-f, sorry that you are facing this error. I believe this is due to the recent tensorflow 2.16.X update. Can you please downgrade the tensorflow version by pip install tensorflow-cpu==2.15.0.post1 and try running again? Thanks

@scharf-f
Copy link
Author

Hey Cytham,

thank you so much for the very quick and helpful reply, it actually worked!

Awesome! :)

Thanks again and kind regards,
Flo

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants