Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grad CAM Map With Memory Saving Looks Odd #40

Open
ghost opened this issue Jul 7, 2019 · 3 comments
Open

Grad CAM Map With Memory Saving Looks Odd #40

ghost opened this issue Jul 7, 2019 · 3 comments

Comments

@ghost
Copy link

ghost commented Jul 7, 2019

@yaroslavvb Have you tried to create grad cam or saliency maps after using memory_saving_gradients? Mine look very odd (columnar). I'm doing the Udacity program, and my keras-vis grad-cam plots look like this:
cam_map_00

@yaroslavvb
Copy link
Collaborator

I haven't....I can't really tell if this looks odd or not, the gradient results should be the same with and without memory saving

@ghost
Copy link
Author

ghost commented Jul 9, 2019

@yaroslavvb I've noticed my model runs faster, with less memory, but with errors when I use the tensorflow implementation of the keras backend (from tensorflow.python.keras._impl.keras import backend as K, or tensorflow.keras.backend in later versions of tensorflow) instead of the backend with my keras install (from keras import backend). The only difference between my code and your keras test code (keras_test.py) is that I use the keras functional model API, e.g.

a = Input(shape=(32,))
b = Dense(32)(a)
model = Model(inputs=a, outputs=b)

instead of the Sequential model (e.g.

model = Sequential()
model.add(Dense(32, activation='relu', input_shape=(32,))
model.add(Dense(16, activation='relu'))
model.compile()

Should I change my code to using the Sequential model if trying to use memory_saving_gradients?

@ghost
Copy link
Author

ghost commented Jul 9, 2019

@yaroslavvb FYI, here is what the cam map looks like, having changed nothing but the keras backend from from tensorflow.python.keras._impl.keras import backend as K to from keras import backend as K:

Figure_1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant