raghakot / keras-vis

Neural network visualization toolkit for keras
https://raghakot.github.io/keras-vis
MIT License
2.98k stars 664 forks source link

AttributeError: 'list'/integer/float object has no attribute 'build_loss' in visualize_saliency_with_losses #227

Open sepehrgolriz opened 4 years ago

sepehrgolriz commented 4 years ago

Hi,

I would like to know if any one has the same problem as me while "visualize_saliency_with_losses" is being used. When I use "visualize_saliency_with_losses" function, I get ....... has no attribute 'build_loss'. I tried different format but each time I am getting the similar error. Moreover, does anybody know how exactly "losses" argument should be define: It is written in the documentation as a list of tuples which means for example [(1,2,2,2),(1,2,2,2)], but it gives me this error : Too many argument to unpack, expected 2, I changed it to [(1,2),(1,2)], it gives me integer object has no attribute 'build_loss'. In this link "https://github.com/raghakot/keras-vis/blob/master/vis/visualization/saliency.py#L50", it is written that it should be formatted as "List of (Loss, weight) tuples." When I changed to that format [([1],2),([1],2)], it gives me this error : AttributeError: 'list' object has no attribute 'build_loss'

In general, what does (lose, weight) mean? what is weight here? and how we can calculate it?

Can anybody help me please. All of your kind help would be appreciated in advance.