GithubHelp home page GithubHelp logo

csailvision / netdissect Goto Github PK

View Code? Open in Web Editor NEW
448.0 448.0 115.0 1.26 MB

Network Dissection http://netdissect.csail.mit.edu for quantifying interpretability of deep CNNs.

License: MIT License

Python 86.10% Shell 8.34% MATLAB 5.56%

netdissect's People

Contributors

davidbau avatar diondrapeck avatar zhoubolei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

netdissect's Issues

Caffe cannot be imported

Where should I put the cloned repo inside the compiled caffe folder in order not to get the import error of no module named caffe?

I have already matcaffe and pycaffe compiled in that folder.

ZeroDivisionError: centered_arange step size is 0

In upsample.py line 352, the step size (3rd param) passed to np.arange is 0, yielding a ZeroDivisionError. This is caused by t having value 1, and reduction having value 2: 1 // 2 = 0. The fieldmap is ((0,0), (4,4), (1,1)).

The conv layer that is being analyzed has a 4x4 kernel, 4 output channels, and a stride of 1. Its input size is 3x120x120, the output size is 4x117x117.

I am going to debug this further but just wanted to share this already.

call() got an unexpected keyword argument 'grid'

@lingeo writes: I ran the code just as the readme shown, while i got this srror:

Traceback (most recent call last):
File "src/labelprobe.py", line 306, in
parallel=args.parallel)
File "src/labelprobe.py", line 101, in label_probe
thresh, labelcat, batch_size, ahead, verbose, parallel)
File "src/labelprobe.py", line 134, in fast_process
result.get(31536000)
File "/usr/lib/python2.7/multiprocessing/pool.py", line 558, in get
raise self._value
TypeError: call() got an unexpected keyword argument 'grid'

Is there anything wrong with my python2.7? or should I use the python3.5? and why?

Identifying concepts in each image

How can I identify a concept in an image? I want to debug the dataset to understand the concepts labelled for each image, but I couldn't find a simple way.
I know that the CSV files in the dataset folder index for each image and its concepts (part, object, etc.). But I couldn't find a way to see the label concept in an image; for example, I'd like to know which image has the wheel part concept. Can I identify this using only the CSV files? If not, could you tell me where in the code can I extract this information?

Generating views fails due to missing files

Running the default script script/rundissect_pytorch.sh fails for the generating view step with the following error traceback:

Writing imgmax
ls: cannot access probes/pytorch_alexnet_imagenet/html/features.html: No such file or directory
Generating views
features
Adding tallys of unit/label alignments.
Generating html summary probes/pytorch_alexnet_imagenet/html-features.html
Sorting units by score.
Visualizing features unit 114
Traceback (most recent call last):
File "src/viewprobe.py", line 429, in
verbose=True)
File "src/viewprobe.py", line 112, in generate_html_summary
imsave(self.ed.filename(['html', imfn]), tiled)
File ".../anaconda2/lib/python2.7/site-packages/scipy/misc/pilutil.py", line 199, in imsave
im.save(name)
File ".../anaconda2/lib/python2.7/site-packages/PIL/Image.py", line 1823, in save
fp = builtins.open(filename, "w+b")
IOError: [Errno 2] No such file or directory: 'probes/pytorch_alexnet_imagenet/html-image/features-0114.jpg'

The directory html-image does not even exist in the generated file structure. What does exist is:
probes/pytorch_alexnet_imagenet/html/image. The last two directories are empty.

Reproducing results

I'm trying to run resnet152 trained on ImageNet using the python wrapper provided in the repository with the standard settings but the results are not the same as in the paper. Any suggestions for that.

VGG16 on Cifar10

This framework works perfectly! I was wondering if this framework can possibly examine the VGG16 trained on the cifar10 dataset?

pytorch wrapper question

Hi,
Where in the code did you remove the mean and divide images by the std?
I could not find this. If it's missing - this could be a potential bug.

Running main.py program timed out

Hi, I try to run net-dissect-lite on win10. pytorch 1.9.0, torchvision0.10.0,
I run it through python main.py, but I encountered an error "OverflowError: timeout value is too large" when extracting features.
The screenshot of the specific error is as follows. I spent a long time to find the relevant solution, but it was not successful.
I guess through the above error message "file missing, loading from scratch" whether it may be caused by mmap_files and mmap_max_files not being generated correctly. I will be very grateful if you can help
image

'none' is not interpreted as None

In rundissect_pytorch.sh the predefined string for WEIGHTS is set to none which in turn is not interpreted as None by the argument parser. This results in an error on loading the network weights.

No such file or directory: 'probes/pytorch_alexnet_imagenet/html-features.html'

script/rundissect_pytorch.sh: line 199: globexists: command not found
Generating graph
Traceback (most recent call last):
File "src/graphprobe.py", line 114, in
stats = summarize(loadviz(directory, blob), args.threshold,
File "src/graphprobe.py", line 20, in loadviz
with open(html_fn) as f:
IOError: [Errno 2] No such file or directory: 'probes/pytorch_alexnet_imagenet/html-features.html'

ValueError: max() arg is an empty sequence

Hi,

I tried your toolbox using my trained model and your broden dataset. I ran rundissect.sh, and I finally got this:

Traceback (most recent call last):
File "src/report.py", line 425, in
verbose=True)
File "src/report.py", line 45, in generate_html_summary
save=ed.filename('html/' + barfn))
File "/home/cc/NetDissect-release1/src/bargraph.py", line 106, in bar_graph_svg
barheight, barwidth, show_labels, filename)
File "/home/cc/NetDissect-release1/src/bargraph.py", line 110, in make_svg_bargraph
unitheight = float(barheight) / max(heights)
ValueError: max() arg is an empty sequence

Do you know how to fix this problem? Thank you.
b.t.w. there is no html folder under NetDissect.

Low threshold values in the paper

Hello everyone,
I would like to understand why the selected threshold value (0.04) in the paper is low? For such a low value, sometimes even random excitation can achieve that IOU right?

problem when use the pytorch version,have no idea with it

Traceback (most recent call last):
File "src/netprobe_pytorch.py", line 291, in
split=args.split, cl_args=args, verbose=True)
File "src/netprobe_pytorch.py", line 52, in create_probe
data = loadseg.SegmentationData(args.dataset)
File "/home/czy/NetDissect/src/loadseg.py", line 63, in init
self.image = [decode_index_dict(r) for r in DictUnicodeReader(f)]
File "/home/czy/NetDissect/src/unicsv.py", line 48, in init
self.reader = csv.DictReader(f, dialect=dialect, **kwds)
File "/home/czy/.conda/envs/python36/lib/python3.6/csv.py", line 87, in init
self.reader = reader(f, dialect, *args, **kwds)
TypeError: argument 1 must be an iterator

to know

Anyone want to do interpretable research on deep learning? Let's add a friend to have a detailed chat.

How to generate number of unique semantic detectors?

Suppose we load the names of the "label" column of the generated csv file into the array label, is the number of unique semantic detectors equal to length(unique(label))?

Also, would it be possible to release the script and data to generate Fig.7 and Fig.8 of the paper? Thanks.

How to process the first conv layer in network?

LAYERS is set to "features" in the default rundissect_pytorch.sh, and after run rundissect_pytorch.sh, I will see the visualized results about the all 256 units from probes/pytorch_alexnet_imagenet/features.html.
My question is if I want to see the scores of the first conv layer in network(such as alexnet) with 64 units, what should I do.
If I need to make some changes to LAYERS in rundissect_pytorch.sh or do something else?
I would be appreciate if the author could clear my confusion.
THANKS!

Adding 299x299 broden dataset (for inception_v3, nasnet, pnasnet, nasnet, etc.)

Hi, how much work would it be to create a 299 version of the broden dataset (to complement the existing 224, 227, 384)? I was hoping it would be as easy as adding a few lines to the makebroden.sh script but I'm not sure (due to the annotations making things a little more complicated, and I don't know what joingseg does).

If someone is able to provide a quick explanation of what steps to take, I would be happy to do them myself, and then make PR if it would be helpful for others. Quite a few popular models use the larger image size.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.