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

Can I "load_model"? #10

Open
Yamadate opened this issue Sep 7, 2017 · 4 comments
Open

Can I "load_model"? #10

Yamadate opened this issue Sep 7, 2017 · 4 comments

Comments

@Yamadate
Copy link

Yamadate commented Sep 7, 2017

Thank you for your great code! I'm trying to use it for other keras classifier models.
However, I got an error shown below with other models than VGG16 as it is.
How can I load model and weights? Is it possible to use "load_model"?

IndexError: list index out of range

@Duanxuxxx
Copy link

Same issue on the Pytorch version:

grads_val = self.extractor.get_gradients()[-1].cpu().data.numpy()

IndexError: list index out of range

@leanderme
Copy link

Probably too late, but change l.name is layer_name to l.name == layer_name:

conv_output =  [l for l in model.layers if l.name == layer_name][0].output

@ttppss
Copy link

ttppss commented Mar 20, 2021

Same issue on the Pytorch version:

grads_val = self.extractor.get_gradients()[-1].cpu().data.numpy()

IndexError: list index out of range

Hi,

Have you found the solution?

Thanks.

@wjlhahaha
Copy link

可能为时已晚,但更改 l.name layer_name l.name == layer_name:

conv_output =  [l for l in model.layers if l.name == layer_name][0].output

您好按照您发的代码修改后仍然报错: conv_output = [l for l in model.layers if l.name == layer_name][0].output
IndexError: list index out of range,请问应该怎样解决呢

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

5 participants