Rup*_*h N 4 python numpy object-identity
我有一个大小为(3997,29)的numpy array(arr)。我正在使用此数组创建数据集。该数组同时具有整数和浮点变量。所以dtype是参考。但是,当我执行它时,出现以下错误。
“ ValueError:不是位置ID(无效的对象ID)”
with h5py.File("test1.h5", 'w') as f:
grp = f.create_group('Nodes')
with h5py.File("test1.h5", 'r+') as f:
grp = f.require_group('Nodes')
ref_dtype = h5py.special_dtype(ref=h5py.Reference)
arrshape = np.shape(arr)
dset = grp.create_dataset('Init' ,arrshape, dtype = ref_dtype , data= arr)
Run Code Online (Sandbox Code Playgroud)
错误发生在最后一行。以下是回溯消息
dset = f.create_dataset('Init',arrshape,dtype = ref_dtype,data = arr)
文件“ C:\ Users \ rupesh.n \ AppData \ Local \ Continuum \ anaconda3 \ lib \ site-packages \ h5py_hl \ group.py”,行108,位于create_dataset中dsid = dataset.make_new_dset(自身,形状,dtype,数据,** kwds)
在make_new_dset dset_id = h5d.create中的文件“ C:\ Users \ rupesh.n \ AppData \ Local \ Continuum \ anaconda3 \ lib \ site-packages \ h5py_hl \ dataset.py”,行137中。 ,sid,dcpl = dcpl)
在h5py._objects.with_phil.wrapper中的文件“ h5py_objects.pyx”第54行
在h5py._objects.with_phil.wrapper中的文件“ h5py_objects.pyx”,第55行
在h5py.h5d.create中的文件“ h5py \ h5d.pyx”,第79行
ValueError:不是位置ID(无效的对象ID)
| 归档时间: |
|
| 查看次数: |
1822 次 |
| 最近记录: |