Closed claraqin closed 5 days ago
For what it's worth, I was able to sidestep this issue by adding a "dummy species" made up of random noise as a second species in the model. It seems like TensorFlow simply doesn't take well to a single-species spatial model for some reason.
Hello,
Thanks a lot for providing a detailed example to replicate the issue that you have encountered!
I confirm that I have run into same error as you did. This type of error is known to us and it is related to the changing shapes of the model parameters due to adaptive number of random factors - something that TensorFlow is not very happy about by default. Though, the source of this particular issue with 1 species is rather mysterious to me as I cannot clearly pinpoint the operation that might change the shape.
Anyway, I have pushed a hotfix for this issue (commit cdc45c3) and tested that your example runs smoothly. Please let us know if this also solves the issue at your side.
Thanks @gtikhonov . Just acknowledging that I received your message, but haven't had a chance to test the fix yet. I will do so in the next couple of days.
It works! Thanks again for your help.
Hello,
First, thanks for providing such a great resource to the community.
I've been encountering an error when I attempt to use Hmsc-HPC to fit a spatial model (i.e. with spatially explicit random effects) to the distribution of a single species:
ValueError: 'params['Psi']' has shape (None, None) after one iteration, which does not conform with the shape invariant (None, 1).
The full traceback is appended to the bottom of this message.Below is a script to reproduce this error with simulated data. The script is based on an example in "Joint Species Distribution with Modelling" by Otso Ovaskainen and Nerea Abrego. Specifically, it's from section 5.6.9 ("Spatial Random Effects").
Here's the full traceback:
Do you have any insights into what might be happening?
With gratitude, Clara