Comments (5)
Hi @diendepzai1998,
thanks for downloading our code.
Did you download the weight file correctly?
from mlnet.
I am facing the same error now. And the weight file has been download correctly.
from mlnet.
Exactly the same problem and I have Keras 1.1 with theano 0.9.
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/aashish/mlnet/model.py", line 44, in ml_net_model
weights = get_weights_vgg16(f, 1)
File "/home/aashish/mlnet/model.py", line 26, in get_weights_vgg16
g = f['layer_{}'.format(id)]
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 "/usr/local/lib/python2.7/dist-packages/h5py/_hl/group.py", line 264, 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
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py/h5o.pyx", line 190, in h5py.h5o.open
KeyError: "Unable to open object (object 'layer_1' doesn't exist)"
Could it be possibly somehow related to this warning:
/home/aashish/mlnet/model.py:18: H5pyDeprecationWarning: The default file mode will change to 'r' (read-only) in h5py 3.0. To suppress this warning, pass the mode you need to h5py.File(), or set the global default h5.get_config().default_file_mode, or set the environment variable H5PY_DEFAULT_READONLY=1. Available modes are: 'r', 'r+', 'w', 'w-'/'x', 'a'. See the docs for details.
Please help.
Regards,
Aashish Neupane
from mlnet.
This is probably due to a too recent version of the h5py package.
Please try to replace line 19 of the model.py
file with:
f = h5py.File("vgg16_weights.h5", mode="r")
Otherwise, you can try to downgrade the h5py package.
Note: be sure to have correctly downloaded the vgg16_weights.h5
under the code root folder.
from mlnet.
@marcellacornia
I also have the exact same problem. I think the problem is in the line 43 of the file main.py.
Where the line "model = ml_net_model(img_cols=shape_c, img_rows=shape_r, downsampling_factor_product=10)" would generate following error:
KeyError Traceback (most recent call last)
in ()
----> 1 model = ml_net_model(img_cols=shape_c, img_rows=shape_r, downsampling_factor_product=10)
C:\mlnet-master\model.pyc in ml_net_model(img_rows, img_cols, downsampling_factor_net, downsampling_factor_product)
24 # FEATURE EXTRACTION NETWORK #
25 #########################################################
---> 26 weights = get_weights_vgg16(f, 1)
27 conv1_1 = Convolution2D(64, 3, 3, weights=weights, activation='relu', border_mode='same')(input_ml_net)
28 weights = get_weights_vgg16(f, 3)
C:\mlnet-master\model.pyc in get_weights_vgg16(f, id)
12
13 def get_weights_vgg16(f, id):
---> 14 g = f['layer_{}'.format(id)]
15 return [g['param_{}'.format(p)] for p in range(g.attrs['nb_params'])]
16
h5py_objects.pyx in h5py._objects.with_phil.wrapper()
h5py_objects.pyx in h5py._objects.with_phil.wrapper()
c:\users\ran.conda\envs\sam\lib\site-packages\h5py_hl\group.pyc in getitem(self, name)
262 raise ValueError("Invalid HDF5 object reference")
263 else:
--> 264 oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
265
266 otype = h5i.get_type(oid)
h5py_objects.pyx in h5py._objects.with_phil.wrapper()
h5py_objects.pyx in h5py._objects.with_phil.wrapper()
h5py\h5o.pyx in h5py.h5o.open()
KeyError: "Unable to open object (object 'layer_1' doesn't exist)"
Please help~ Thank you very much :D
from mlnet.
Related Issues (20)
- can't use ratio and frac_ratio together Error HOT 2
- about your provided weights of ML-Net HOT 2
- about fine-tune on MIT1003 HOT 2
- About the multi layer HOT 4
- Reproducing results when training using only SALICON dataset HOT 6
- can you provide loss value curve ?
- pytorch HOT 3
- are vgg weights only being used for feature extraction? HOT 2
- some question about training process。
- Exception: Layer weight shape (3, 3, 640, 64) not compatible with provided weight shape (64, 3, 3, 3) HOT 3
- Broken vgg16_weights.h5 link in README HOT 2
- ImportError: cannot import name 'Layer' from 'keras.layers.core' HOT 1
- How to learn the prior maps in your method?
- Incompatibility between weights of the model layers and vgg16_weights.h5 file!! HOT 1
- Layer weight shape (3, 3, 640, 64) not compatible with provided weight shape (64, 3, 3, 3) HOT 3
- Outputs must be theano variables or Out instances
- input
- Broken mlnet_salicon_weights.pkl link in README HOT 1
- Getting image heatmap from saliency map and original image
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mlnet.