代碼:
f = h5py.File('xxx/G2.h5', 'r')
錯誤:
OSError: Unable to open file (unable to lock file, errno = 11, error message = 'Resource temporarily unavailable')
一般 OSError 都是文件路徑的問題,但此處不同。
解決辦法:(linux下打開終端)
cp xxx/G2.h5 ~
並重新修改文件路徑:
f = h5py.File('~/G2.h5', 'r')
個人認為原因可能是文件權限的問題。