You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-9Lines changed: 20 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,10 @@
1
1
# efficient_densenet_pytorch
2
-
A PyTorch implementation of DenseNets, optimized to save GPU memory.
2
+
A PyTorch 0.4 implementation of DenseNets, optimized to save GPU memory.
3
3
4
4
## Recent updates
5
-
1.**Now works on PyTorch 0.3.x!**
6
-
1.`models/densenet_efficient_multi_gpu.py` is now depricated. `models/densenet_efficient.py` can handle both single and multi-GPU setups.
5
+
1.**Now works on PyTorch 0.4!** It uses the checkpointing feature, which makes this code WAY more efficient!!!
6
+
1.**No longer works with PyTorch 0.3.x.** If you are using an old version of PyTorch, check out [the pytorch_0.3.1 tag](https://github.com/gpleiss/efficient_densenet_pytorch/tree/pytorch_0.3.1) for an older version of this code.
7
+
1.`models/densenet_efficient.py` is now depricated. `models/densenet.py` can handle both the efficient and original implementations.
7
8
8
9
## Motivation
9
10
While DenseNets are fairly easy to implement in deep learning frameworks, most
@@ -23,21 +24,25 @@ For more details, please see the [technical report](https://arxiv.org/pdf/1707.0
23
24

24
25
25
26
## Requirements
26
-
- PyTorch 0.3.x
27
+
- PyTorch 0.4
27
28
- CUDA
28
29
30
+
**N.B.** If you are using PyTorch 0.3.x, please check out [the 0.3.x compatible version](https://github.com/gpleiss/efficient_densenet_pytorch/tree/pytorch_0.3.1).
31
+
29
32
## Usage
30
33
31
34
**In your existing project:**
32
-
There are two files in the `models` folder.
33
-
-`models/densenet.py` is a "naive" implementation, based off the [torchvision](https://github.com/pytorch/vision/blob/master/torchvision/models/densenet.py) and
35
+
There is one file in the `models` folder.
36
+
-`models/densenet.py` is an implementation based off the [torchvision](https://github.com/pytorch/vision/blob/master/torchvision/models/densenet.py) and
-`models/densenet_efficient.py` is the new efficient implementation. (Code is still a little ugly. We're working on cleaning it up!)
36
-
Copy either one of those files into your project!
38
+
39
+
If you care about speed, and memory is not an option, pass the `efficient=False` argument into the `DenseNet` constructor.
40
+
Otherwise, pass in `efficient=True`.
37
41
38
42
**Options:**
39
43
- All options are described in [the docstrings of the model files](https://github.com/gpleiss/efficient_densenet_pytorch/blob/master/models/densenet_efficient.py#L189)
40
44
- The depth is controlled by `block_config` option
45
+
-`efficient=True` uses the memory-efficient version
41
46
- If you want to use the model for ImageNet, set `small_inputs=False`. For CIFAR or SVHN, set `small_inputs=True`.
42
47
43
48
**Running the demo:**
@@ -47,7 +52,13 @@ The only extra package you need to install is [python-fire](https://github.com/g
0 commit comments