experiencor / deep-viz-keras

Implementations of some popular Saliency Maps in Keras
https://experiencor.github.io/cnn_visual.html
164 stars 31 forks source link

TypeError: __init__() missing 3 required positional arguments: 'session', 'y', and 'x' #2

Open DawnMe opened 6 years ago

DawnMe commented 6 years ago

Running the example for vanilla gradient caused error: ` TypeError Traceback (most recent call last)

in () 58 from saliency import GradientSaliency ---> 59 vanilla = GradientSaliency(model) 60 61 mask = vanilla.get_mask(img) TypeError: __init__() missing 3 required positional arguments: 'session', 'y', and 'x' ` ``` from saliency import GradientSaliency model = load_model('some_model.hdf5', compile=False) model.compile(loss='mean_squared_error', optimizer='adam') vanilla = GradientSaliency(model) mask = vanilla.get_mask(img) show_image(mask, ax=plt.subplot('121'), title='vanilla gradient') mask = vanilla.get_smoothed_mask(img) show_image(mask, ax=plt.subplot('122'), title='smoothed vanilla gradient') ```
experiencor commented 6 years ago

@DawnMe Can I know the tensorflow version that you use? I use tensorflow 1.3.

DawnMe commented 6 years ago

@experiencor tensorflow 1.4.0.