Saving in hdf5save creates an unreadable file

后端 未结 2 613
[愿得一人]
[愿得一人] 2020-12-20 00:22

I\'m trying to save an array as a HDF5 file using R, but having no luck.

To try and diagnose the problem I ran example(hdf5save). This successfully crea

2条回答
  •  一生所求
    2020-12-20 01:04

    I've also run into the same issue and found a reasonable fix.

    The issue seems like it stems from when the hdf5 library finalizes the file. If it doesn't get a chance to finalize the file, then the file is corrupted. I think this happens after the buffer is flushed but the buffer doesn't always flush.

    One solution I've found is to do the hdf5save in a separate function. Assign the variables into the globalenv(), then call hdf5save and exit the function. When the function completes, the memory seems to clean up which makes the hdf5 libarary flush the buffer and finalize the file.

    Hope this helps!

提交回复
热议问题