【问题标题】:Unable to create reference of HDF5 dataset in Python无法在 Python 中创建 HDF5 数据集的引用
【发布时间】:2016-05-09 15:40:41
【问题描述】:

我正在使用 HDF5 python lib h5py 并希望通过

从 HDF5 数据集创建引用
ref = DATASET.regionref[:, :, 0]

但是,我收到一个错误

 ValueError: Unable to create reference (No write intent on file)

事实上,我没有也不想用写权限打开文件。我能做什么?

【问题讨论】:

    标签: python hdf5 h5py


    【解决方案1】:

    如果文件没有以写访问权限打开,h5py 似乎不允许区域引用。原因可能是这些引用充当了numpy数组allowing reading and writing

    我在 HDF5 format specification 中没有发现太多提及区域引用,所以我想原则上可以将它们设为只读。这可能是对 h5py 的增强请求。

    目前我宁愿直接在 numpy 数组上使用视图/切片,如果这符合您的需要的话。

    【讨论】:

      猜你喜欢
      • 2014-03-04
      • 2021-09-29
      • 2012-11-22
      • 2019-02-04
      • 2015-11-13
      • 1970-01-01
      • 2015-05-18
      • 2021-11-09
      • 2018-11-20
      相关资源
      最近更新 更多