Closed jinchenglee closed 6 years ago
Hi, @jinchenglee .
keras-vis is supported both. We have been testing with python 2.7 and 3.6 on the travisci (but testcase might not be enough....) .
Please tell us the detail of your problems, we might be able to resolve them.
Thanks for prompt reply. I did see it installed into both 2.7 and 3.5 directories.
I noticed two issues when running visualize_attention.ipynb notebook:
1) It seems keras-vis assumes 'channels_last', I see error reported out as I used 'channels_first' in my .keras. This is easily fixed locally to np.transpose input image.
from vis.visualization import visualize_saliency, overlay
titles = ['right steering', 'left steering', 'maintain steering'] modifiers = [None, 'negate', 'small_values'] for i, modifier in enumerate(modifiers): heatmap = visualize_saliency(model, layer_idx=-1, filter_indices=0, seed_input=bgr_img, grad_modifier=modifier) plt.figure() plt.title(titles[i])
plt.imshow(overlay(img, heatmap, alpha=0.7))
I tried to change bgr_img to the channels_first version, still same error.
InvalidArgumentError Traceback (most recent call last)
I see this is related to Tensorflow 1.8.0 which I am using now. It is aprpeciated you can upgrade support TF to 1.8.0. Thanks.
@jinchenglee , Thank for your comment.
- It seems keras-vis assumes 'channels_last', I see error reported out as I used 'channels_first' in my .keras. This is easily fixed locally to np.transpose input image.
No, keras-vis supporte both the channels_last
and channels_first
.
Please show us your error log if you could.
- I got error running visualize_saliency():
This problem was solved by PR #120 .
Please install keras-vis via source code (i.e., setup.py
) or follow as:
pip install git+https://github.com/raghakot/keras-vis.git -U
Solved the issue. Thanks.
I'm glad :smile:
I doubt maybe some issues are caused by the fact that I only use python3.5.