Sometimes I get this error while working on TensorFlow models or h5py.
Actually, this happens when HDF5 is used externally or internally and the file you are trying to access gets locked by HDF5.
We can fix it by disabling HDF5 File Locking by overriding the environment variable ‘HDF5_USE_FILE_LOCKING’ by-
os.environ[“HDF5_USE_FILE_LOCKING”] = “FALSE”
Note- Include this code before loading the model.