marcellacornia / mlnet

A Deep Multi-Level Network for Saliency Prediction. ICPR 2016
MIT License
94 stars 37 forks source link

error #5

Closed njss closed 7 years ago

njss commented 7 years ago

I always get an error when executing: python main.py /image_folder

File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/tmp/pip-4rPeHA-build/h5py/_objects.c:2684) File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/tmp/pip-4rPeHA-build/h5py/_objects.c:2642) File "/home/nsilva/anaconda2/lib/python2.7/site-packages/h5py/_hl/group.py", line 166, in getitem oid = h5o.open(self.id, self._e(name), lapl=self._lapl) File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/tmp/pip-4rPeHA-build/h5py/_objects.c:2684) File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/tmp/pip-4rPeHA-build/h5py/_objects.c:2642) File "h5py/h5o.pyx", line 190, in h5py.h5o.open (/tmp/pip-4rPeHA-build/h5py/h5o.c:3570) KeyError: "Unable to open object (Object 'layer_1' doesn't exist)"

marcellacornia commented 7 years ago

Hi @njss, sorry for the delay. Which is your Keras version?

laloutre12 commented 7 years ago

Yes same here :

Using Theano backend. Traceback (most recent call last): File "main.py", line 43, in model = ml_net_model(img_cols=shape_c, img_rows=shape_r, downsampling_factor_product=10) File "/home/sebastien/Dropbox/projects/mlnet/model.py", line 26, in ml_net_model weights = get_weights_vgg16(f, 1) File "/home/sebastien/Dropbox/projects/mlnet/model.py", line 14, in get_weightsvgg16 g = f['layer{}'.format(id)] File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/tmp/pip-4rPeHA-build/h5py/_objects.c:2684) File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/tmp/pip-4rPeHA-build/h5py/_objects.c:2642) File "/usr/local/lib/python2.7/dist-packages/h5py/_hl/group.py", line 166, in getitem oid = h5o.open(self.id, self._e(name), lapl=self._lapl) File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/tmp/pip-4rPeHA-build/h5py/_objects.c:2684) File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/tmp/pip-4rPeHA-build/h5py/_objects.c:2642) File "h5py/h5o.pyx", line 190, in h5py.h5o.open (/tmp/pip-4rPeHA-build/h5py/h5o.c:3570) KeyError: "Unable to open object (Object 'layer_1' doesn't exist)"

farshidfarhat commented 7 years ago

Same problem for me:

Using TensorFlow backend. Traceback (most recent call last): File "main.py", line 43, in model = ml_net_model(img_cols=shape_c, img_rows=shape_r, downsampling_factor_product=10) File "/Users/fuf111/Downloads/mlnet/model.py", line 26, in ml_net_model weights = get_weights_vgg16(f, 1) File "/Users/fuf111/Downloads/mlnet/model.py", line 14, in get_weightsvgg16 g = f['layer{}'.format(id)] File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/Users/travis/build/MacPython/h5py-wheels/h5py/h5py/_objects.c:2687) File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/Users/travis/build/MacPython/h5py-wheels/h5py/h5py/_objects.c:2645) File "/usr/local/lib/python2.7/site-packages/h5py/_hl/group.py", line 166, in getitem oid = h5o.open(self.id, self._e(name), lapl=self._lapl) File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/Users/travis/build/MacPython/h5py-wheels/h5py/h5py/_objects.c:2687) File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/Users/travis/build/MacPython/h5py-wheels/h5py/h5py/_objects.c:2645) File "h5py/h5o.pyx", line 190, in h5py.h5o.open (/Users/travis/build/MacPython/h5py-wheels/h5py/h5py/h5o.c:3573) KeyError: "Unable to open object (Object 'layer_1' doesn't exist)"

baraldilorenzo commented 7 years ago

Guys, let me clarify two points:

1) As stated in the README file, only Theano is supported. 2) We cannot reproduce the issue unless you answer to our questions. Again: which version of Keras are you using?

Best,

farshidfarhat commented 7 years ago

Hi,

  1. I "pip install"ed "theano" as well. But I tried on MAC OS X 12.10.3
  2. My "keras" version is 1.2.2

Best, FF

rasmith commented 7 years ago

I have Theano 0.8.2 and Keras 1.2.2 and get the same error. I tried with Theano 0.8.0, 0.8.1, 0.9.0rc1, and Keras 1.1.2 and still no luck.

rasmith commented 7 years ago

Using Theano backend. Traceback (most recent call last): File "main.py", line 43, in model = ml_net_model(img_cols=shape_c, img_rows=shape_r, downsampling_factor_product=10) File "/Users/randallsmith/Documents/github/mlnet/model.py", line 26, in ml_net_model weights = get_weights_vgg16(f, 1) File "/Users/randallsmith/Documents/github/mlnet/model.py", line 14, in get_weightsvgg16 g = f['layer{}'.format(id)] File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/Users/travis/build/MacPython/h5py-wheels/h5py/h5py/_objects.c:2687) File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/Users/travis/build/MacPython/h5py-wheels/h5py/h5py/_objects.c:2645) File "/usr/local/lib/python2.7/site-packages/h5py/_hl/group.py", line 166, in getitem oid = h5o.open(self.id, self._e(name), lapl=self._lapl) File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/Users/travis/build/MacPython/h5py-wheels/h5py/h5py/_objects.c:2687) File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/Users/travis/build/MacPython/h5py-wheels/h5py/h5py/_objects.c:2645) File "h5py/h5o.pyx", line 190, in h5py.h5o.open (/Users/travis/build/MacPython/h5py-wheels/h5py/h5py/h5o.c:3573) KeyError: "Unable to open object (Object 'layer_1' doesn't exist)"

rasmith commented 7 years ago

Hello, I've installed all versions of Keras and can never get this to work. With all versions of Keras >= 1.0.0, the same error as above is reproduced.

rasmith commented 7 years ago

I got this to work. One has to check the 'vgg16_weights.h5' file to make sure it is not corrupt.

Alinadi23 commented 6 years ago

This program runs on GPU? or we can run it on CPU?