pukeskywalker
Posts: 1
Joined: Mon May 20, 2019 1:19 pm

OSError: Unable to open file ,Please help thnaks a lot.

Mon May 20, 2019 1:26 pm

Traceback (most recent call last):
File "test_network.py", line 44, in <module>
model = load_model("project_110.model")
File "/usr/local/lib/python3.5/dist-packages/keras/engine/saving.py", line 417, in load_model
f = h5dict(filepath, 'r')
File "/usr/local/lib/python3.5/dist-packages/keras/utils/io_utils.py", line 186, in __init__
self.data = h5py.File(path, mode=mode)
File "/usr/local/lib/python3.5/dist-packages/h5py/_hl/files.py", line 312, in __init__
fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
File "/usr/local/lib/python3.5/dist-packages/h5py/_hl/files.py", line 142, in make_fid
fid = h5f.open(name, flags, fapl=fapl)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py/h5f.pyx", line 78, in h5py.h5f.open
OSError: Unable to open file (truncated file: eof = 1294336, sblock->base_addr = 0, stored_eof = 15083056)

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 22728
Joined: Sat Jul 30, 2011 7:41 pm

Re: OSError: Unable to open file ,Please help thnaks a lot.

Mon May 20, 2019 1:33 pm

Might be useful to know what you were trying to do rather than just providing a stack trace.

Usual reasons for not being able to open a file

It doesnt exist
You are looking for it in the wrong place
Permissions don't allow you to open it
You opened it to write and it is write protected
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

Return to “Python”