Skip to content
Pattarawat Chormai edited this page Mar 3, 2022 · 8 revisions

Introduction

This contain steps to reproduce NetDissect results (via NetDissect-Lite) for VGG16 trained on ImageNet and Places365. These modes are provided in .caffe by the authors of NetDissect. We convert these caffe models to PyTorch using this Colab notebook.

This notebook shows how to use the models.

Model Provider Dataset acc@1 acc@5 Links
torchvision imagenet ... .... [Model] [NetDissect]
netdissect imagenet ... ... [Model] [NetDissect]
places365 ... ... [Model] [NetDissect]

Setup

Hardware Environment

The NetDissect reproduction was done on an EC2 instance the following technical details

instance-type: p2.xlarge
storage: 500GB 
ami: Deep Learning AMI GPU PyTorch 1.10.0 (Amazon Linux 2) 20211115

For SSH and TMUX

printf '\ePtmux;\e\e[<u\e\\'

TERM=xterm-256color ssh ec2-user@IP

Python Dependencies

Make sure we use the correct version of Python used. Here, we use 3.8.6.

$ conda create -n python386 python=3.8.6 

$ conda activate python386  && python --version

$ pip install torch torchvision  scikit-image

Download Datasets and Models

$ ./script/dlbroden.sh
$ ./script/script/dlcaffe_vgg16.sh

Execution Statistics

We perform NetDissect per model-layer. The process contains 3 stages, namely

  • Extracting features: ~5m
  • Processing Quantizes: ~10m
  • Label Probing: ~2h (1000 images takes 2 mins); We have in total ~64,000 images in Broden.

In total, it takes ~2h30m per model-layer.