Closed tonystark12 closed 6 years ago
Edit : The complete error :
ValueError Traceback (most recent call last)
Hi, @tonystark12 . Your guessed is right. Could you try following? :
from keras.utils import CustomObjectScope
with CustomObjectScope({'AcceptRejectPooling2D': AcceptRejectPooling2D}):
model = utils.apply_modifications(model)
and
with CustomObjectScope({'AcceptRejectPooling2D': AcceptRejectPooling2D}):
grads = visualize_saliency(model, layer_idx, filter_indices=class_idx, seed_input=X_train[idx], backprop_modifier='guided')
hey @keisen
Thank you for your reply. This is the error I got now. based on the changes I made.
TypeError: ('Keyword argument not understood:', 'strides')
I feel the custom ayer is not being recognized. Is there some form of initialization that I am missing? The complete code is attached along with this comment, in case required.
modifiedstochastic.py - the custom layer defined codes.zip
The complete error o/p here :
TypeError Traceback (most recent call last)
Can you modify modifiedstochastic.py
to that comment out the 159 lines?
Or add strides
argument to __init__
method?
@keisen
Thank you for your patience again. Could you please elaborate more on adding strides to init.py? I have created an empty file for project purposes, and thus do not have any functions there.
Doesn't commenting out strides affect the layer data ?
Commenting out strides helped. Thank you once again for your time. If possible. could you please give me a gist or explaining the issue I faced?
When a model is serialized, the config
in dict of return value of Layer#get_config()
is saved as one of model's parameters.
Then when the model is deserialized, the config
value is passed to __init__()
method as arguments.
The error you faced was occured becase deserialized strides
value can't be passed the __init__()
as arguments.
....Maybe.
I am not familiar with keras's design, so I might make mistake.
First off, thank you for providing,contributing and making this package, which has been helpful to me for many research based projects.
I am facing the following error statement
when trying to run keras-vis. The code block causing the error :
I have used keras-vis for inbuilt layers and it works great. How do I make use of it for custom layers? I am using WIN 10, with python 3.6.5, and jupyter 4.4.0
Thanks in advance. Please let me know if any other info can help.