Skip to content

Commit e5c8726

Browse files
authored
Merge pull request #57 from lukemelas/add_b7
Add B6, B7 models and AutoAugment models
2 parents 50a2bf2 + 2fcfe51 commit e5c8726

File tree

6 files changed

+27
-13
lines changed

6 files changed

+27
-13
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
# EfficientNet PyTorch
22

3-
### Update (June 29, 2019)
3+
### Update (July 31, 2019)
44

55
_Upgrade the pip package with_ `pip install --upgrade efficientnet-pytorch`
66

7+
The B6 and B7 models are now available. Additionally, _all_ pretrained models have been updated to use AutoAugment preprocessing, which translates to better performance across the board. Usage is the same as before:
8+
```python
9+
from efficientnet_pytorch import EfficientNet
10+
model = EfficientNet.from_pretrained('efficientnet-b7')
11+
```
12+
13+
### Update (June 29, 2019)
14+
715
This update adds easy model exporting ([#20](https://github.com/lukemelas/EfficientNet-PyTorch/issues/20)) and feature extraction ([#38](https://github.com/lukemelas/EfficientNet-PyTorch/issues/38)).
816

917
* [Example: Export to ONNX](#example-export)
@@ -124,8 +132,8 @@ Details about the models are below:
124132
| `efficientnet-b3` | 12M | 81.1 ||
125133
| `efficientnet-b4` | 19M | 82.6 ||
126134
| `efficientnet-b5` | 30M | 83.3 ||
127-
| `efficientnet-b6` | 43M | 84.0 | - |
128-
| `efficientnet-b7` | 66M | 84.4 | - |
135+
| `efficientnet-b6` | 43M | 84.0 | |
136+
| `efficientnet-b7` | 66M | 84.4 | |
129137

130138

131139
#### Example: Classification

efficientnet_pytorch/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.3.0"
1+
__version__ = "0.4.0"
22
from .model import EfficientNet
33
from .utils import (
44
GlobalParams,

efficientnet_pytorch/utils.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -276,12 +276,14 @@ def get_model_params(model_name, override_params):
276276

277277

278278
url_map = {
279-
'efficientnet-b0': 'http://storage.googleapis.com/public-models/efficientnet-b0-08094119.pth',
280-
'efficientnet-b1': 'http://storage.googleapis.com/public-models/efficientnet-b1-dbc7070a.pth',
281-
'efficientnet-b2': 'http://storage.googleapis.com/public-models/efficientnet-b2-27687264.pth',
282-
'efficientnet-b3': 'http://storage.googleapis.com/public-models/efficientnet-b3-c8376fa2.pth',
283-
'efficientnet-b4': 'http://storage.googleapis.com/public-models/efficientnet-b4-e116e8b3.pth',
284-
'efficientnet-b5': 'http://storage.googleapis.com/public-models/efficientnet-b5-586e6cc6.pth',
279+
'efficientnet-b0': 'http://storage.googleapis.com/public-models/efficientnet/efficientnet-b0-355c32eb.pth',
280+
'efficientnet-b1': 'http://storage.googleapis.com/public-models/efficientnet/efficientnet-b1-f1951068.pth',
281+
'efficientnet-b2': 'http://storage.googleapis.com/public-models/efficientnet/efficientnet-b2-8bb594d6.pth',
282+
'efficientnet-b3': 'http://storage.googleapis.com/public-models/efficientnet/efficientnet-b3-5fb5a3c3.pth',
283+
'efficientnet-b4': 'http://storage.googleapis.com/public-models/efficientnet/efficientnet-b4-6ed6700e.pth',
284+
'efficientnet-b5': 'http://storage.googleapis.com/public-models/efficientnet/efficientnet-b5-b6417697.pth',
285+
'efficientnet-b6': 'http://storage.googleapis.com/public-models/efficientnet/efficientnet-b6-c76e70fd.pth',
286+
'efficientnet-b7': 'http://storage.googleapis.com/public-models/efficientnet/efficientnet-b7-dcc49843.pth',
285287
}
286288

287289
def load_pretrained_weights(model, model_name, load_fc=True):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
1919
AUTHOR = 'Luke'
2020
REQUIRES_PYTHON = '>=3.5.0'
21-
VERSION = '0.3.0'
21+
VERSION = '0.4.0'
2222

2323
# What packages are required for this module to be executed?
2424
REQUIRED = [

tf_to_pytorch/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ I should also emphasize that you do *not* need to run any of this code to load p
77
That being said, the main script here is `convert_to_tf/load_tf_weights.py`. In order to use it, you should first download the pretrained TensorFlow weights:
88
```bash
99
cd pretrained_tensorflow
10-
./download.sh
10+
./download.sh efficientnet-b0
1111
cd ..
1212
```
1313
Then
@@ -19,3 +19,7 @@ python load_tf_weights.py \
1919
--tf_checkpoint ../pretrained_tensorflow/efficientnet-b0/ \
2020
--output_file ../pretrained_pytorch/efficientnet-b0.pth
2121
```
22+
23+
<!-- Here is a helpful utility:
24+
mv efficientnet-b0.pth efficientnet-b0-$(sha256sum efficientnet-b0.pth | head -c 8).pth
25+
-->

tf_to_pytorch/pretrained_tensorflow/download.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
# ./download.sh efficientnet-b3
1010

1111
MODEL=$1
12-
wget https://storage.googleapis.com/cloud-tpu-checkpoints/efficientnet/${MODEL}.tar.gz
12+
wget https://storage.googleapis.com/cloud-tpu-checkpoints/efficientnet/ckptsaug/${MODEL}.tar.gz
1313
tar xvf ${MODEL}.tar.gz
1414
rm ${MODEL}.tar.gz

0 commit comments

Comments
 (0)