H5py IOError:无法写入数据

时间:2017-06-13 22:46:02

标签: h5py ioerror

对于深度学习项目,我将hdf5文件中的数据重组为包含batch0 ... batch_max的大training_data.hfd5 当它在我的笔记本电脑上本地运行它可以工作,但过程有点长(很多数据),所以我试图在我有权访问的大CPU服务器上运行它。 现在我有这个错误:

Traceback (most recent call last):
  File "prepare_data.py", line 88, in <module>
    main(readargs())
  File "prepare_data.py", line 82, in main
    prepare_data('', args)
  File "prepare_data.py", line 72, in prepare_data
    args.preprocessdatadir, args.datadir, stdout=None)
  File "/home/bizeul/Stage/GCNN-1/GCNN_Icube/data_prepare_cube/group_batch.py", line 113, in group_batchs
    curr_batch_idx, count_events = organizer.iter_data()
  File "/home/bizeul/Stage/GCNN-1/GCNN_Icube/data_prepare_cube/group_batch.py", line 93, in iter_data
    self.next_batch(batchsize)
  File "/home/bizeul/Stage/GCNN-1/GCNN_Icube/data_prepare_cube/group_batch.py", line 65, in next_batch
    self.next_event(fileout)
  File "/home/bizeul/Stage/GCNN-1/GCNN_Icube/data_prepare_cube/group_batch.py", line 82, in next_event
    fileout[self.group_name + '/label'][self.event_idx] = label
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/home/bizeul/virtual_cpu/build/h5py/h5py/_objects.c:2840)
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/home/bizeul/virtual_cpu/build/h5py/h5py/_objects.c:2798)
  File "/home/bizeul/virtual_cpu/lib/python2.7/site-packages/h5py/_hl/dataset.py", line 630, in __setitem__
    self.id.write(mspace, fspace, val, mtype, dxpl=self._dxpl)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/home/bizeul/virtual_cpu/build/h5py/h5py/_objects.c:2840)
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/home/bizeul/virtual_cpu/build/h5py/h5py/_objects.c:2798)
  File "h5py/h5d.pyx", line 221, in h5py.h5d.DatasetID.write (/home/bizeul/virtual_cpu/build/h5py/h5py/h5d.c:3680)
  File "h5py/_proxy.pyx", line 132, in h5py._proxy.dset_rw (/home/bizeul/virtual_cpu/build/h5py/h5py/_proxy.c:2022)
  File "h5py/_proxy.pyx", line 93, in h5py._proxy.H5PY_H5Dwrite (/home/bizeul/virtual_cpu/build/h5py/h5py/_proxy.c:1732)
IOError: Can't write data (No appropriate function for conversion path)

您认为这是什么问题?

1 个答案:

答案 0 :(得分:0)

有同样的问题。我试图用一组图像和标签创建一个数据集。但没有调整大小。将所有图像调整为相同大小后,我能够运行代码并创建数据集。

img = cv2.resize(img,(500,500))

阅读图像后调整大小