Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AttributeError: 'Dataset' object has no attribute 'value'

Tags:

hdf5

h5py

I got this error when using a package to read hdf5 files:

dataset.value

Error:

Traceback (most recent call last):
  File "train.py", line 163, in <module>
    train(0, False, args.gpu_list, args.model_path)
  File "train.py", line 76, in train
    dataset = Ani1Dataset(dir_path='/data/ANI-1_release')
  File "/code/ani1dataset.py", line 16, in __init__
    self.parse(dir_path)
  File "/code/ani1dataset.py", line 32, in parse
    for molecule in adl:
  File "/code/pyanitools.py", line 75, in __iter__
    for data in self.h5py_dataset_iterator(self.store):
  File "/code/pyanitools.py", line 71, in h5py_dataset_iterator
    yield from self.h5py_dataset_iterator(item, path)
  File "/code/pyanitools.py", line 60, in h5py_dataset_iterator
    dataset = np.array(item[k].value)
AttributeError: 'Dataset' object has no attribute 'value'
like image 907
Jacob Stern Avatar asked Apr 16 '26 05:04

Jacob Stern


1 Answers

The dataset.value attribute was deprecated. Either use:

dataset[()]

or downgrade h5py to use the old syntax:

pip3 install --upgrade pip && pip3 install h5py=='2.9.0'
like image 119
Jacob Stern Avatar answered Apr 19 '26 22:04

Jacob Stern



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!