Using h5py.File(path,'r')
or (Keras) model.load_weights(path)
on .h5
files yields the below error. I've trained models on Colab for months, never had this problem. The same files open just fine on my computer when downloaded from Drive. At first one notebook failed to open .h5
files - all others followed soon after.
What's the error, and how to troubleshoot? Inability to save & load models renders Colab unusable - help is appreciated.
UPDATE: What started as inability to open
h5
files morphed into inability to import simple modules - which somehow restored ability to load some of the h5
files. I changed nothing in code. No clue where it's headed, but all errors display Input/output error
NOTE: bytes_actually_read
= 18.4 Exa-bytes, O(10^19)
UPDATE2: It works again now, but due to no effort of my own - I still don't know what the problem was, or how to address it if it recurs.
UPDATE3: Same error recurred - now affecting files sporadically; some are permitted to load half-way, some not at all, then those that loaded halfway don't load at all.
OSError: Unable to open file (file read failed: time = Fri Sep 6 04:24:56 2019,
filename = '../models/model_to_cont.h5', file descriptor = 76, errno = 5,
error message = 'Input/output error', buf = 0x7ffc08af5430, total read size = 8,
bytes this sub-read = 8, bytes actually read = 18446744073709551615, offset = 0)
----> 1 from utils_data_methods import print_key_configs
/usr/lib/python3.6/importlib/_bootstrap.py in _find_and_load(name, import_)
/usr/lib/python3.6/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)
/usr/lib/python3.6/importlib/_bootstrap.py in _load_unlocked(spec)
/usr/lib/python3.6/importlib/_bootstrap_external.py in exec_module(self, module)
/usr/lib/python3.6/importlib/_bootstrap_external.py in get_code(self, fullname)
/usr/lib/python3.6/importlib/_bootstrap_external.py in get_data(self, path)
OSError: [Errno 5] Input/output error
Upon accessing an hdf5 key:
RuntimeError: Link iteration failed (file read failed: time = Fri Sep 6 14:10:45 2019,
filename = '../data/4256superbatch.h5', file descriptor = 76, errno = 5,
error message = 'Input/output error', buf = 0x5fad400, total read size = 512,
bytes this sub-read = 512, bytes actually read = 18446744073709551615, offset = 6692938977)
来源:https://stackoverflow.com/questions/57815855/oserror-input-output-error-google-colab