davidbau / dissect

Code for the Proceedings of the National Academy of Sciences 2020 article, "Understanding the Role of Individual Units in a Deep Neural Network"
Other
301 stars 50 forks source link

Error while running the notebook dissect_classifier_experiment.ipynb #12

Open Vikramank opened 2 years ago

Vikramank commented 2 years ago

I encountered the following error while running dissect_classifier_experiment.ipynb

compute_acts() takes 1 positional argument but 2 were given

while executing the following cell unit_images = iv.masked_images_for_topk( compute_acts, dataset, topk, k=5, num_workers=30, pin_memory=True, cachefile=resfile('top5images.npz'))

I checked out the helper functions. Could you please help me?

choutianxius commented 1 year ago

In the same code cell, just change def compute_acts(image_batch): to def compute_acts(image_batch, *args):