Comments (5)
Hi @zwacke , it depends on what you've set for n_steps. Integrated Gradients needs to compute gradients at each of the n_steps points, so one input image expands to a batch of n_step evaluations, which is likely causing the out of memory issue.
You can try either reducing n_steps to a smaller value or otherwise using the internal_batch_size argument in IG, which splits the evaluations into batches with at most internal_batch_size examples. Setting internal_batch_size to a smaller value (corresponding to a batch size that can fit in memory) while keeping n_steps the same should also work. Let us know if this resolves the issue!
from captum.
Yes, thank you it did. Defaulting to a working internal_batch_size seems to be the recommendable approach. If I get it right, this especially helps when wrapping an attribution method in NoiseTunnel, or any method that introduces further expansion of the overall input batch size.
from captum.
I encountered the same problem today. By reducing n_steps
to a smaller value, it works now.
from captum.
Hi @zwacke, did Vivek's suggestion help ? If so can we close the issue ?
from captum.
Nice! Glad that it helped. Feel free to close the issue if it's fixed!
from captum.
Related Issues (20)
- Addition of Important Direction Gradient Integration (IDGI) framework
- Explainability for embeddings
- Uninitialized target_tokens Variable in LLMGradientAttribution.attribute Method
- what is the meaning of contribution? HOT 1
- For sentence classification using BERT, PAD token is used in IG/Deeplift? HOT 1
- Integrated Gradients for Llama2
- BertForMultipleChoice works without captum, breaks with it?
- Possible to modify initial LRP score to compute CLRP(contrastive lrp)?
- Incorrect indexing for max pooling layers with DeepLIFT HOT 1
- Integrated gradient on a function of models
- NoiseTunnel on LayerIntegratedGradients Perturbs Input Instead of Attribution Target (RunetimeError)
- Integrated Gradients for Frame-Level Classification Tasks
- What is the proper shape of baselines for DeepLiftShap?
- Adding IDGI to Captum HOT 4
- TCAV score computation doesn't preserve experimental set order
- Getting target dimension is not valid even though the output shape is shape in GRAD CAM .
- Deconvoltion and KernelSHAP methods create uninformative attribution maps
- TypeError: 'Concept' object is not iterable HOT 1
- Integrated Gradient without edge attribute
- Integrated Gradients for Llama2 May Produce Unstable Explanations for Long Contexts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from captum.