-
Notifications
You must be signed in to change notification settings - Fork 16
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
Exception: RuntimeError: structure and input must have equal rank #15
Comments
Ater some more testing (still within my Conda environment) I've discovered that other methods also don't work e.g. I will have to do some experimenting to see whether I can replicate this issue outside Conda. |
The more testing I do, the less convinced I am that it's an issue with Conda/Azure. I created a brand new Conda environment with Python 3.8.6 (I don't think
It took a long time to solve the environment, but it got there eventually! I then opened up PyCharm, set the interpreter to my brand new conda environment (called 'geotest'). I ran the following:
But received the error:
This can be replicated with the .tif file attached to this comment. |
Hey @simon-tarr , I was facing the same issue and looked into the source code a bit. Therefore, maybe check the dimension of your object raster.values: # Check the dimension
print(type(raster.values))
print(raster.values.shape)
print(raster.values.ndim)
if out_image.ndim >= 3:
raster.values = np.squeeze(raster.values) Maybe this helps. |
Description
Some preamble - I'm actually running
pylandstats
within a conda environment as I'm developing some code to run with Azure Functions. So I'm not sure if the below error is due to a problem with my conda environment, how Azure Functions is executing the code or whether it is actually a problem withpylandstats
.I'm posting this 'bug' here on the off-chance that someone may have seen this error outside of conda.
Please feel free to delete this bug/issue if it's not in any way related to
pylandstats
!Trying to run
compute_patch_metrics_df()
produces the following error:My code:
My
conda
environment has the following libs/packages installed:I have checked which dependencies
pylandstats
requires with:and can't see anything listed there which isn't included in my list of packages/libraries in my Conda environment.
Thanks!
The text was updated successfully, but these errors were encountered: