Open aphan-sevendreamers opened 6 years ago
Is there a quickfix?
I am visualizing my own model with mobilenet based structure. This works for me. Proceed with caution though.
backend/tensorflow_backend.py Line 52: def modify_model_backprop(model,backprop_modifier,custom_objects): Line 85: modified_model = load_model(model_path,custom_objects=custom_objects) Line 111: modified_model=load_model(model_path,custom_objects=custom_objects)
visualization/saliency.py Line 83: def visualize_saliency(....,custom_objects=None) Line120: model = modifier_fn(model,custom_objects)
Line 192: def visualize_cam(...,custom_objects=None): Line 229: model = modifier_fn(model,custom_objects)
vis/backprop_modifiers.py
Line 7: def guided(model,custom_objects) Line 17: return backend.modify_model_backprop(model,'guided',custom_objects) Line 20: def rectified(model,custom_objects) Line 30: return backend.modify_model_backprop(model,'rectified',custom_objects)
Cheers,
Thanks a lot! Saliency works with this (at least it gives meaningfull results). CAM gives me only one 224x224 Matrix for my 224x224x3 image.
Would you mind post your CAM function in saliency.py here. I doubt it is the problem of version between installing via PiPy and the main branch.
Nope it wasn't. Looks fine for CAM as well, thx again.
can someone help with this? I could find no examples in the documentation to generate guided grad_CAM as shown in the paper (with the point-wise multiplication of guided_back propagation and a bi-linear interpolated grad_CAM). It would be great if someone can answer this question, add this function to the toolkit or give the same here for instance.
[v] Check that you are up-to-date with the master branch of keras-vis. You can update with: pip install git+git://github.com/raghakot/keras-vis.git --upgrade --no-deps
[v] If running on TensorFlow, check that you are up-to-date with the latest version. The installation instructions can be found here.
[v] If running on Theano, check that you are up-to-date with the master branch of Theano. You can update with: pip install git+git://github.com/Theano/Theano.git --upgrade --no-deps
[ ] Provide a link to a GitHub Gist of a Python script that can reproduce your issue (or just copy the script here if it is short).
tensorflow_backend.py should be modified in line 85 to allow custom_objects (and saliency.py, backprop_modifiers.py accordingly).