chainer.serializers.save_hdf5

chainer.serializers.save_hdf5(filename, obj, compression=4)[source]

Saves an object to the file in HDF5 format.

This is a short-cut function to save only one object into an HDF5 file. If you want to save multiple objects to one HDF5 file, use HDF5Serializer directly by passing appropriate h5py.Group objects.

Parameters
  • filename (str) – Target file name.

  • obj – Object to be serialized. It must support serialization protocol. If it is a dictionary object, the serialization will be skipped.

  • compression (int) – Gzip compression level.

Note

Currently save_hdf5() only supports writing to an actual file on file system due to a limitation of HD5F library. See h5py/h5py#687 for details.