image-quality-assessment icon indicating copy to clipboard operation
image-quality-assessment copied to clipboard

Oserror: cannot open file

Open razbrim opened this issue 4 years ago • 1 comments

I get the following error, trying to evaluate an image.

2020-03-14 13:46:36.250641: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 2020-03-14 13:46:36.296629: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 1596305000 Hz 2020-03-14 13:46:36.300492: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x439bda0 executing computations on platform Host. Devices: 2020-03-14 13:46:36.304989: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): Host, Default Version Traceback (most recent call last): File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/src/evaluater/predict.py", line 73, in main(**args.dict) File "/src/evaluater/predict.py", line 44, in main nima.nima_model.load_weights(weights_file) File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/keras/engine/training.py", line 181, in load_weights return super(Model, self).load_weights(filepath, by_name) File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/keras/engine/network.py", line 1171, in load_weights with h5py.File(filepath, 'r') as f: File "/usr/local/lib/python3.6/dist-packages/h5py/_hl/files.py", line 408, in init swmr=swmr) File "/usr/local/lib/python3.6/dist-packages/h5py/_hl/files.py", line 173, 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 88, in h5py.h5f.open OSError: Unable to open file (file read failed: time = Sat Mar 14 13:46:42 2020 , filename = '/src/weights.hdf5', file descriptor = 3, errno = 21, error message = 'Is a directory', buf = 0x7ffcb046eba0, total read size = 8, bytes this sub-read = 8, bytes actually read = 18446744073709551615, offset = 0)

razbrim avatar Mar 14 '20 13:03 razbrim

I could solve the error by removing spaces from my directory path.

I had this path:

/Users/peterpeter/Documents/_ Code/_nima/image-quality-assessment-master

After removing the space in _ Code and changing it to _Code I successfully could run the predict command.

suissemaxx avatar Apr 07 '20 12:04 suissemaxx