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

Feature Detection HDF5-DIAG Error #388

Closed
sortland33 opened this issue Dec 8, 2023 · 7 comments
Closed

Feature Detection HDF5-DIAG Error #388

sortland33 opened this issue Dec 8, 2023 · 7 comments

Comments

@sortland33
Copy link

sortland33 commented Dec 8, 2023

When running tobac.feature_detection.feature_detection_multithreshold I am running into an error (see below) that prints out on repeat. Of course, I wasn't seeing this until I recreated my python environment a couple of days ago, and I didn't think to save what my previous env versions were. Perhaps something has changed in the last couple of months to cause this?

Sometimes it doesn't seem to affect the actual code from running but is somewhat annoying as it keeps spewing the error message out. Other times it seems to fail.

tobac version: 1.5.1
xarray version: 2023.11.0
iris version: 3.4.1

My dataset (has worked on this size of dataset before):

<xarray.Dataset>
Dimensions:            (time: 288, Y: 3000, X: 5000)
Coordinates:
  * time               (time) datetime64[ns] 2022-06-18T00:01:17 ... 2022-06-...
    longitude          (Y, X) float64 inf inf inf inf ... -61.92 -61.91 -61.91
    latitude           (Y, X) float64 inf inf inf inf ... 14.63 14.63 14.63
    proj_y             (Y, X) float64 4.589e+06 4.589e+06 ... 1.584e+06
    proj_x             (Y, X) float64 -3.627e+06 -3.626e+06 ... 1.382e+06
Dimensions without coordinates: Y, X
Data variables:
    thundercast_preds  (time, Y, X) float32 dask.array<chunksize=(1, 3000, 5000), meta=np.ndarray>

Code for feature detecting:

    ds_iris = ds['thundercast_preds'].to_iris()
    dxy, deltat = tobac.get_spacings(ds_iris, grid_spacing=1000)
    feature_detection_params = dict()
    feature_detection_params['threshold'] = [0.1, 0.9]
    feature_detection_params['target'] = 'maximum'
    feature_detection_params['position_threshold'] = 'weighted_diff'
    feature_detection_params['n_erosion_threshold'] = 4
    feature_detection_params['sigma_threshold'] = 2
    feature_detection_params['n_min_threshold'] = 3
    feature_detection_params['min_distance'] = 15000
    pred_features = tobac.feature_detection.feature_detection_multithreshold(field_in=ds_iris, dxy=dxy, **feature_detection_params)

Error:

HDF5-DIAG: Error detected in HDF5 (1.12.2) thread 1:
  #000: H5A.c line 528 in H5Aopen_by_name(): can't open attribute
    major: Attribute
    minor: Can't open object
  #001: H5VLcallback.c line 1091 in H5VL_attr_open(): attribute open failed
    major: Virtual Object Layer
    minor: Can't open object
  #002: H5VLcallback.c line 1058 in H5VL__attr_open(): attribute open failed
    major: Virtual Object Layer
    minor: Can't open object
  #003: H5VLnative_attr.c line 130 in H5VL__native_attr_open(): can't open attribute
    major: Attribute
    minor: Can't open object
  #004: H5Aint.c line 545 in H5A__open_by_name(): unable to load attribute info from object header
    major: Attribute
    minor: Unable to initialize object
  #005: H5Oattribute.c line 494 in H5O__attr_open_by_name(): can't locate attribute: '_QuantizeGranularBitRoundNumberOfSignificantDigits'
    major: Attribute
    minor: Object not found

Things I have tried: reverting to earlier versions of tobac and reverting to an earlier version of xarray -> no luck getting it to go away so far.

@w-k-jones
Copy link
Member

Hi @sortland33 , thanks for reporting this. This seems to be an issue with python loading the data from file during processing. Could you let us know what version of the following libraries you have installed: python, hdf5

@sortland33
Copy link
Author

@w-k-jones Ack! I should have thought to include those above. Sorry about that.

python: 3.11.6
hdf5: 1.12.2

@w-k-jones
Copy link
Member

I think the problem may be similar to what is reported here: SciTools/iris#5187 as a clash between hdf4 v1.12.2 and libnetcdf v4.9.1. Could you see what version of libnetcdf you have, and if it is 4.9.1 try downgrading it to 4.8.1. Otherwise you may have to try upgrading both hdf5 and libnetcdf to the latest versions (v1.14.3 and v4.9.2 respectively)

@freemansw1
Copy link
Member

HDF5 issues are only second to time issues in causing me the most headaches over the past 5 years.

@sortland33
Copy link
Author

sortland33 commented Dec 8, 2023

@w-k-jones Thanks for the suggestions! Good news, bad news.

Bad news:
I was able to downgrade libnetcdf to v4.9.1 (was already v4.9.2) but the error code was still showing up during feature detection. Alternatively I tried to get hdf5 to the newest version with the newest libnetcdf version as suggested, but this caused all sorts of chaos. I'm using micromamba for environment building and it was complaining it could not solve environment specs with hdf5 at that version.

Good news:
So, I created a bare-bones type environment with only the packages I absolutely needed to run my tobac object script in the .yml file (python, numpy, xarray, iris, tobac, libnetcdf=4.9.2, hdf5=1.14.3, pyresample) and it seems to have gotten rid of the error. It's just annoying that I can't use my "general" environment set-up I use for other things.

So the newest versions fix the issue, but other users may run into this if they have environment conflicts that prevent them from installing the newest hdf5 and libnetcdf versions.

@freemansw1 Dealing with this hdf5 thing is nightmarish. It seems this was a can of worms I was not prepared to deal with on a Friday :P

@freemansw1
Copy link
Member

@sortland33, it seems like this has been resolved; can we close this issue?

@sortland33
Copy link
Author

@freemansw1 Yes, this is all set to be resolved. Thanks

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

No branches or pull requests

3 participants