Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Issues testing Deepsphere #13

Open
javierhndev opened this issue Jun 5, 2024 · 3 comments
Open

Issues testing Deepsphere #13

javierhndev opened this issue Jun 5, 2024 · 3 comments

Comments

@javierhndev
Copy link

Hi,
I've been having issues running the quick_start notebook (and also the 'pytest test')

The environment I'm using (ujsing you requirements.txt): Python 3.10.12, TF 2.16.1, scipy 1.8.0, no GPU

When I run the quick_start notebook, I got an error when
model.build(input_shape=(None, len(indices), 1))
is executed.

The error says:
`
File ~/****/deepsphere-cosmo-tf2/deepsphere/gnn_layers.py:81, in Chebyshev.build(self, input_shape)
79 stddev = 1 / np.sqrt(Fin * (self.K + 0.5) / 2)
80 initializer = tf.initializers.TruncatedNormal(stddev=stddev)
---> 81 self.kernel = self.add_weight("kernel", shape=[self.K * Fin, Fout],
82 initializer=initializer, **self.kwargs)
83 else:
84 self.kernel = self.add_weight("kernel", shape=[self.K * Fin, Fout],
85 initializer=self.initializer, **self.kwargs)

TypeError: Layer.add_weight() got multiple values for argument 'shape'
`

When I try the 'pytest tests' I got similar errors:
========================================================== short test summary info ========================================================== FAILED tests/test_gnn_layers.py::test_Chebyshev - TypeError: Layer.add_weight() got multiple values for argument 'shape' FAILED tests/test_gnn_layers.py::test_Monimials - TypeError: Layer.add_weight() got multiple values for argument 'shape' FAILED tests/test_gnn_layers.py::test_Bernstein - TypeError: Layer.add_weight() got multiple values for argument 'shape' FAILED tests/test_gnn_layers.py::test_GCNN_ResidualLayer - TypeError: Exception encountered when calling GCNN_ResidualLayer.call(). FAILED tests/test_gnn_transformers.py::test_Graph_ViT - TypeError: Layer.add_weight() got multiple values for argument 'initializer' FAILED tests/test_gnn_transformers.py::test_Graph_Transformer - TypeError: Layer.add_weight() got multiple values for argument 'initializer' FAILED tests/test_healpy_layers.py::test_HealpyChebyshev - TypeError: Layer.add_weight() got multiple values for argument 'shape' FAILED tests/test_healpy_layers.py::test_HealpyMonomial - TypeError: Layer.add_weight() got multiple values for argument 'shape' FAILED tests/test_healpy_layers.py::test_Healpy_ResidualLayer - TypeError: Exception encountered when calling GCNN_ResidualLayer.call(). FAILED tests/test_healpy_networks.py::test_HealpyGCNN_plotting - TypeError: Layer.add_weight() got multiple values for argument 'shape' FAILED tests/test_healpy_networks.py::test_HealpyGCNN - TypeError: Layer.add_weight() got multiple values for argument 'shape'

Is a problem of the environment? Have you encountered this before?
Thank you!

@jafluri
Copy link
Collaborator

jafluri commented Jun 8, 2024

Hello,

Thanks for your interest in DeepSphere and sorry for the late reply. I am currently traveling and have only limited internet access for some time.

Have you tried downgrading your Tensorflow version, e.g. to 2.14?

Once I am back, I'll be able to recreate the environment and help you more.

Best,

Janis

@javierhndev
Copy link
Author

Thank you! That was it. I downgraded Tensorflow to 2.14.0 and now it works!

Also, another small issue I found in the 'advanced tutorial'. Current versions of numpy complain about 'np.bool' since it was deprecated. Switching to 'bool' was fine.

@jafluri
Copy link
Collaborator

jafluri commented Jun 12, 2024

Great, thanks for letting me know. I will leave the issue open until I have time to fix everything properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants