Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion Issue #8

Closed
rose-jinyang opened this issue Nov 26, 2020 · 5 comments
Closed

Conversion Issue #8

rose-jinyang opened this issue Nov 26, 2020 · 5 comments

Comments

@rose-jinyang
Copy link

Hello
How are you?
Thanks for contributing this project.
I have a Keras model.
I am going to convert this model to NCNN.
I tried to do this with your script.

But I met the following issue.

Reading and parsing keras h5df file...
Traceback (most recent call last):
File "keras2ncnn.py", line 1625, in
H5dfParser(args.input_file).parse_graph(keras_graph)
File "keras2ncnn.py", line 99, in parse_graph
self.parse_sequential_graph(graph_helper)
File "keras2ncnn.py", line 110, in parse_sequential_graph
layers['config']['layers'], graph_helper)
File "keras2ncnn.py", line 131, in parse_model_graph
layer['name'])})
File "keras2ncnn.py", line 72, in find_weights_root
layer = layer[layer_name]
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 "C:\Users\admin\Anaconda3\envs\py37_tf1.x\lib\site-packages\h5py_hl\group.py", line 262, 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 'input_1' doesn't exist)"

u can get the keras model from here: https://we.tl/t-ZdD7JQK1Xf
environment:
Keras: 2.3.1
Tensorflow: 1.14.0
h5py: 2.9.0

@MarsTechHAN
Copy link
Owner

MarsTechHAN commented Nov 27, 2020

That's a pretty weird issue. I will have a look on it.

@rose-jinyang
Copy link
Author

Thanks

@rose-jinyang
Copy link
Author

rose-jinyang commented Dec 3, 2020

Hi
Not yet?

@MarsTechHAN
Copy link
Owner

I was too busy last week. It seems like your keras model was a sequential model with multiple stage in series. I still need some time to figure where it store the weights. I think it will be done in this week :p

@MarsTechHAN
Copy link
Owner

It should work since 25d0378.
btw, I change how the package structured, be sure to follow the new guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants