diff --git a/toolkit.py b/toolkit.py
index f108d1da7bedf4707e3ca16cefcbe5d75bf39023..c91a6473823d92ecb79c0bd1af8337886caa16ec 100755
--- a/toolkit.py
+++ b/toolkit.py
@@ -516,7 +516,7 @@ class ClassificationProject(object):
                     os.symlink(srcpath, filename)
                     logger.info("Created symlink from {} to {}".format(srcpath, filename))
             logger.info("Trying to load {} from {}".format(dataset_name, filename))
-            with h5py.File(filename) as hf:
+            with h5py.File(filename, "r") as hf:
                 setattr(self, dataset_name,  hf[dataset_name][:])
         logger.info("Data loaded")