MisaOgura / flashtorch

Visualization toolkit for neural networks in PyTorch! Demo -->
https://youtu.be/18Iw4qYqfPo
MIT License
727 stars 88 forks source link

3D images #33

Open jiequanz opened 4 years ago

jiequanz commented 4 years ago

Hi, I am trying to modify this repo to make it fit on 3D images (64 by 64 by 64)

I have a couple questions.

1, Why did you only take the first Conv2d layer here? image

2, I noticed that if I reset "backprop = Backprop(model)", and call "backprop.visualize" again, the "_record_gradients(module, grad_in, grad_out)" will be called twice. If I repeat again, the " _record_gradients(module, grad_in, grad_out)" will be called 3 times. This continue to grow each time I reset "backprop = Backprop(model)". Do you know why? This is shown below. ------------------------------------------------------------------------------- image ------------------------------------------------------------------------------- image ------------------------------------------------------------------------------- image ------------------------------------------------------------------------------- image -------------------------------------------------------------------------------

3, I had to remove the line self.model.eval() in the initiation of Backprop to get values for gradients; otherwise the gradient is going to be zero everywhere.

Thanks! Please let me know if you know what happened.

MisaOgura commented 4 years ago

Hi @Jiequannnnnnnnnn,

Apologies for the delayed reply - I've been busy with personal stuff over the past month.

Great to see FlashTorch applied to images of brain (I think?). For my own curiosity, can you tell me a bit more about your project?

I will have some time to address the existing issues/questions in the next week or so, so please expect some update on this soon.

Sorry again for the wait & thanks for your patience!