Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #193 from awslabs/keras-mxnet-2.2.4
Browse files Browse the repository at this point in the history
Keras-mxnet 2.2.4 release
  • Loading branch information
roywei authored Oct 9, 2018
2 parents f195d7a + 2f05a6b commit 8ad5f3d
Show file tree
Hide file tree
Showing 144 changed files with 6,699 additions and 3,486 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ fail_under = 85
show_missing = True
omit =
keras/applications/*
keras/preprocessing/*
keras/datasets/*
keras/layers/cudnn_recurrent.py
keras/legacy/*
Expand Down
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/a--tensorflow-backend-users.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: a) TensorFlow backend users
about: Select this is you're using Keras with the TensorFlow backend (default).

---

Please make sure that the boxes below are checked before you submit your issue.
If your issue is an **implementation question**, please ask your question on [StackOverflow](http://stackoverflow.com/questions/tagged/keras) or [on the Keras Slack channel](https://keras-slack-autojoin.herokuapp.com/) instead of opening a GitHub issue.

Thank you!

- [ ] Check that you are up-to-date with the master branch of Keras. You can update with:
`pip install git+git://github.com/keras-team/keras.git --upgrade --no-deps`

- [ ] Check that your version of TensorFlow is up-to-date. The installation instructions can be found [here](https://www.tensorflow.org/get_started/os_setup).

- [ ] Provide a link to a GitHub Gist of a Python script that can reproduce your issue (or just copy the script here if it is short).
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/b--theano-backend-users.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: b) Theano backend users
about: Select this if you're using Keras with the Theano backend.

---

Please make sure that the boxes below are checked before you submit your issue.
If your issue is an **implementation question**, please ask your question on [StackOverflow](http://stackoverflow.com/questions/tagged/keras) or [on the Keras Slack channel](https://keras-slack-autojoin.herokuapp.com/) instead of opening a GitHub issue.

Thank you!

- [ ] Check that you are up-to-date with the master branch of Keras. You can update with:
`pip install git+git://github.com/keras-team/keras.git --upgrade --no-deps`

- [ ] Check that you are up-to-date with the master branch of Theano. You can update with:
`pip install git+git://github.com/Theano/Theano.git --upgrade --no-deps`

- [ ] Provide a link to a GitHub Gist of a Python script that can reproduce your issue (or just copy the script here if it is short).
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/c--cntk-backend-users.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: c) CNTK backend users
about: Select this if you're using Keras with the CNTK backend.

---

Please make sure that the boxes below are checked before you submit your issue.
If your issue is an **implementation question**, please ask your question on [StackOverflow](http://stackoverflow.com/questions/tagged/keras) or [on the Keras Slack channel](https://keras-slack-autojoin.herokuapp.com/) instead of opening a GitHub issue.

Thank you!

- [ ] Check that you are up-to-date with the master branch of Keras. You can update with:
`pip install git+git://github.com/keras-team/keras.git --upgrade --no-deps`

- [ ] Check that your version of CNTK is up-to-date.

- [ ] Provide a link to a GitHub Gist of a Python script that can reproduce your issue (or just copy the script here if it is short).
57 changes: 21 additions & 36 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
sudo: required
dist: trusty
language: python
cache:
directories:
- $HOME/.theano
matrix:
include:
- python: 2.7
env: KERAS_BACKEND=tensorflow TEST_MODE=PEP8
- python: 2.7
env: KERAS_BACKEND=tensorflow TEST_MODE=INTEGRATION_TESTS
- python: 3.6
env: KERAS_BACKEND=tensorflow TEST_MODE=DOC
env: KERAS_BACKEND=tensorflow TEST_MODE=PEP8_DOC
- python: 2.7
env: KERAS_BACKEND=tensorflow
- python: 3.6
Expand All @@ -21,10 +22,6 @@ matrix:
env: KERAS_BACKEND=cntk PYTHONWARNINGS=ignore
- python: 3.6
env: KERAS_BACKEND=cntk PYTHONWARNINGS=ignore
- python: 2.7
env: KERAS_BACKEND=mxnet PYTHONWARNINGS=ignore
- python: 3.6
env: KERAS_BACKEND=mxnet PYTHONWARNINGS=ignore
install:
# code below is taken from http://conda.pydata.org/docs/travis.html
# We do this conditionally because it saves us some downloading if the
Expand All @@ -42,40 +39,33 @@ install:
# Useful for debugging any issues with conda
- conda info -a

- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION nose scipy matplotlib pandas pytest h5py
- travis_retry conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION
- source activate test-environment
- pip install --only-binary=numpy,scipy numpy nose scipy matplotlib h5py theano
- travis_retry pip install --only-binary=numpy,scipy,pandas numpy nose scipy matplotlib h5py theano pytest pytest-pep8 pandas
- pip install keras_applications keras_preprocessing
- conda install mkl mkl-service

# set library path
- export LD_LIBRARY_PATH=$HOME/miniconda/envs/test-environment/lib/:$LD_LIBRARY_PATH

# install PIL for preprocessing tests
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
conda install pil;
else
conda install Pillow;
# install PIL for preprocessing tests (they are integration tests).
- if [[ "$TEST_MODE" == "INTEGRATION_TESTS" ]] || [[ "$TEST_MODE" == "PEP8_DOC" ]]; then
if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
export PIL=Pil;
else
export PIL=Pillow;
fi
fi

# install pydot for visualization tests
- travis_retry conda install mkl mkl-service pydot graphviz $PIL

- pip install -e .[tests]

# install TensorFlow (CPU version).
- pip install tensorflow==1.7

# install Apache MXNet (CPU version).
- pip install mxnet
- pip install --upgrade numpy

# install cntk
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
pip install https://cntk.ai/PythonWheel/CPU-Only/cntk-2.5.1-cp27-cp27mu-linux_x86_64.whl;
elif [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then
pip install https://cntk.ai/PythonWheel/CPU-Only/cntk-2.5.1-cp36-cp36m-linux_x86_64.whl;
fi
- pip install tensorflow==1.9

# install pydot for visualization tests
- conda install pydot graphviz
# install cntk
- pip install cntk

# exclude different backends to measure a coverage for the designated backend only
- if [[ "$KERAS_BACKEND" != "tensorflow" ]]; then
Expand All @@ -87,9 +77,6 @@ install:
- if [[ "$KERAS_BACKEND" != "cntk" ]]; then
echo ' keras/backend/cntk_backend.py' >> .coveragerc;
fi
- if [[ "$KERAS_BACKEND" != "mxnet" ]]; then
echo ' keras/backend/mxnet_backend.py' >> .coveragerc;
fi

# detect whether core files are changed or not
- export CORE_CHANGED=False;
Expand Down Expand Up @@ -118,10 +105,8 @@ script:
- echo -e "Running tests with the following config:\n$(cat ~/.keras/keras.json)"
- if [[ "$TEST_MODE" == "INTEGRATION_TESTS" ]]; then
PYTHONPATH=$PWD:$PYTHONPATH py.test tests/integration_tests;
elif [[ "$TEST_MODE" == "PEP8" ]]; then
PYTHONPATH=$PWD:$PYTHONPATH py.test --pep8 -m pep8 -n0;
elif [[ "$TEST_MODE" == "DOC" ]]; then
PYTHONPATH=$PWD:$PYTHONPATH py.test tests/test_documentation.py;
elif [[ "$TEST_MODE" == "PEP8_DOC" ]]; then
PYTHONPATH=$PWD:$PYTHONPATH py.test --pep8 -m pep8 -n0 && py.test tests/test_documentation.py;
else
PYTHONPATH=$PWD:$PYTHONPATH py.test tests/ --ignore=tests/integration_tests --ignore=tests/test_documentation.py --ignore=tests/keras/legacy/layers_test.py --cov-config .coveragerc --cov=keras tests/;
fi
5 changes: 3 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ RUN conda install -y python=${python_version} && \
pip install --upgrade pip && \
pip install \
sklearn_pandas \
tensorflow-gpu && \
pip install https://cntk.ai/PythonWheel/GPU/cntk-2.1-cp36-cp36m-linux_x86_64.whl && \
tensorflow-gpu \
cntk-gpu && \
conda install \
bcolz \
h5py \
Expand All @@ -52,6 +52,7 @@ RUN conda install -y python=${python_version} && \
notebook \
Pillow \
pandas \
pydot \
pygpu \
pyyaml \
scikit-learn \
Expand Down
2 changes: 2 additions & 0 deletions docs/autogen.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@

EXCLUDE = {
'Optimizer',
'TFOptimizer',
'Wrapper',
'get_session',
'set_session',
Expand Down Expand Up @@ -173,6 +174,7 @@
layers.SeparableConv2D,
layers.Conv2DTranspose,
layers.Conv3D,
layers.Conv3DTranspose,
layers.Cropping1D,
layers.Cropping2D,
layers.Cropping3D,
Expand Down
42 changes: 23 additions & 19 deletions docs/templates/applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,19 @@ model = InceptionV3(input_tensor=input_tensor, weights='imagenet', include_top=T

| Model | Size | Top-1 Accuracy | Top-5 Accuracy | Parameters | Depth |
| ----- | ----: | --------------: | --------------: | ----------: | -----: |
| [Xception](#xception) | 88 MB | 0.790 | 0.945| 22,910,480 | 126 |
| [VGG16](#vgg16) | 528 MB| 0.715 | 0.901 | 138,357,544 | 23
| [VGG19](#vgg19) | 549 MB | 0.727 | 0.910 | 143,667,240 | 26
| [ResNet50](#resnet50) | 99 MB | 0.759 | 0.929 | 25,636,712 | 168
| [InceptionV3](#inceptionv3) | 92 MB | 0.788 | 0.944 | 23,851,784 | 159 |
| [InceptionResNetV2](#inceptionresnetv2) | 215 MB | 0.804 | 0.953 | 55,873,736 | 572 |
| [MobileNet](#mobilenet) | 17 MB | 0.665 | 0.871 | 4,253,864 | 88
| [DenseNet121](#densenet) | 33 MB | 0.745 | 0.918 | 8,062,504 | 121
| [DenseNet169](#densenet) | 57 MB | 0.759 | 0.928 | 14,307,880 | 169
| [DenseNet201](#densenet) | 80 MB | 0.770 | 0.933 | 20,242,984 | 201

| [Xception](#xception) | 88 MB | 0.790 | 0.945 | 22,910,480 | 126 |
| [VGG16](#vgg16) | 528 MB | 0.713 | 0.901 | 138,357,544 | 23 |
| [VGG19](#vgg19) | 549 MB | 0.713 | 0.900 | 143,667,240 | 26 |
| [ResNet50](#resnet50) | 99 MB | 0.749 | 0.921 | 25,636,712 | 168 |
| [InceptionV3](#inceptionv3) | 92 MB | 0.779 | 0.937 | 23,851,784 | 159 |
| [InceptionResNetV2](#inceptionresnetv2) | 215 MB | 0.803 | 0.953 | 55,873,736 | 572 |
| [MobileNet](#mobilenet) | 16 MB | 0.704 | 0.895 | 4,253,864 | 88 |
| [MobileNetV2](#mobilenetv2) | 14 MB | 0.713 | 0.901 | 3,538,984 | 88 |
| [DenseNet121](#densenet) | 33 MB | 0.750 | 0.923 | 8,062,504 | 121 |
| [DenseNet169](#densenet) | 57 MB | 0.762 | 0.932 | 14,307,880 | 169 |
| [DenseNet201](#densenet) | 80 MB | 0.773 | 0.936 | 20,242,984 | 201 |
| [NASNetMobile](#nasnet) | 23 MB | 0.744 | 0.919 | 5,326,716 | - |
| [NASNetLarge](#nasnet) | 343 MB | 0.825 | 0.960 | 88,949,818 | - |

The top-1 and top-5 accuracy refers to the model's performance on the ImageNet validation dataset.

Expand Down Expand Up @@ -269,7 +271,7 @@ The default input size for this model is 224x224.
has to be `(224, 224, 3)` (with `'channels_last'` data format)
or `(3, 224, 224)` (with `'channels_first'` data format).
It should have exactly 3 inputs channels,
and width and height should be no smaller than 48.
and width and height should be no smaller than 32.
E.g. `(200, 200, 3)` would be one valid value.
- pooling: Optional pooling mode for feature extraction
when `include_top` is `False`.
Expand Down Expand Up @@ -324,7 +326,7 @@ The default input size for this model is 224x224.
has to be `(224, 224, 3)` (with `'channels_last'` data format)
or `(3, 224, 224)` (with `'channels_first'` data format).
It should have exactly 3 inputs channels,
and width and height should be no smaller than 48.
and width and height should be no smaller than 32.
E.g. `(200, 200, 3)` would be one valid value.
- pooling: Optional pooling mode for feature extraction
when `include_top` is `False`.
Expand Down Expand Up @@ -381,7 +383,7 @@ The default input size for this model is 224x224.
has to be `(224, 224, 3)` (with `'channels_last'` data format)
or `(3, 224, 224)` (with `'channels_first'` data format).
It should have exactly 3 inputs channels,
and width and height should be no smaller than 197.
and width and height should be no smaller than 32.
E.g. `(200, 200, 3)` would be one valid value.
- pooling: Optional pooling mode for feature extraction
when `include_top` is `False`.
Expand Down Expand Up @@ -436,7 +438,7 @@ The default input size for this model is 299x299.
has to be `(299, 299, 3)` (with `'channels_last'` data format)
or `(3, 299, 299)` (with `'channels_first'` data format).
It should have exactly 3 inputs channels,
and width and height should be no smaller than 139.
and width and height should be no smaller than 75.
E.g. `(150, 150, 3)` would be one valid value.
- pooling: Optional pooling mode for feature extraction
when `include_top` is `False`.
Expand Down Expand Up @@ -491,7 +493,7 @@ The default input size for this model is 299x299.
has to be `(299, 299, 3)` (with `'channels_last'` data format)
or `(3, 299, 299)` (with `'channels_first'` data format).
It should have exactly 3 inputs channels,
and width and height should be no smaller than 139.
and width and height should be no smaller than 75.
E.g. `(150, 150, 3)` would be one valid value.
- pooling: Optional pooling mode for feature extraction
when `include_top` is `False`.
Expand Down Expand Up @@ -618,9 +620,11 @@ The default input size for this model is 224x224.
to use as image input for the model.
- input_shape: optional shape tuple, only to be specified
if `include_top` is False (otherwise the input shape
has to be `(224, 224, 3)` (with `channels_last` data format)
or `(3, 224, 224)` (with `channels_first` data format).
It should have exactly 3 inputs channels.
has to be `(224, 224, 3)` (with `'channels_last'` data format)
or `(3, 224, 224)` (with `'channels_first'` data format).
It should have exactly 3 inputs channels,
and width and height should be no smaller than 32.
E.g. `(200, 200, 3)` would be one valid value.
- pooling: optional pooling mode for feature extraction
when `include_top` is `False`.
- `None` means that the output of the model will be
Expand Down
6 changes: 3 additions & 3 deletions docs/templates/datasets.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ from keras.datasets import cifar10

- __Returns:__
- 2 tuples:
- __x_train, x_test__: uint8 array of RGB image data with shape (num_samples, 3, 32, 32).
- __x_train, x_test__: uint8 array of RGB image data with shape (num_samples, 3, 32, 32) or (num_samples, 32, 32, 3) based on the `image_data_format` backend setting of either `channels_first` or `channels_last` respectively.
- __y_train, y_test__: uint8 array of category labels (integers in range 0-9) with shape (num_samples,).


Expand All @@ -34,7 +34,7 @@ from keras.datasets import cifar100

- __Returns:__
- 2 tuples:
- __x_train, x_test__: uint8 array of RGB image data with shape (num_samples, 3, 32, 32).
- __x_train, x_test__: uint8 array of RGB image data with shape (num_samples, 3, 32, 32) or (num_samples, 32, 32, 3) based on the `image_data_format` backend setting of either `channels_first` or `channels_last` respectively.
- __y_train, y_test__: uint8 array of category labels with shape (num_samples,).

- __Arguments:__
Expand Down Expand Up @@ -206,4 +206,4 @@ from keras.datasets import boston_housing
- __test_split__: fraction of the data to reserve as test set.

- __Returns:__
Tuple of Numpy arrays: `(x_train, y_train), (x_test, y_test)`.
Tuple of Numpy arrays: `(x_train, y_train), (x_test, y_test)`.
8 changes: 4 additions & 4 deletions docs/templates/getting-started/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- [How can I use HDF5 inputs with Keras?](#how-can-i-use-hdf5-inputs-with-keras)
- [Where is the Keras configuration file stored?](#where-is-the-keras-configuration-file-stored)
- [How can I obtain reproducible results using Keras during development?](#how-can-i-obtain-reproducible-results-using-keras-during-development)
- [How can I install HDF5 or h5py to save my models in Keras?](#how-can-i-install-HDF5-or-h5py-to-save-my-models-in-Keras)
- [How can I install HDF5 or h5py to save my models in Keras?](#how-can-i-install-hdf5-or-h5py-to-save-my-models-in-keras)

---

Expand Down Expand Up @@ -149,7 +149,7 @@ You can then use `keras.models.load_model(filepath)` to reinstantiate your model
`load_model` will also take care of compiling the model using the saved training configuration
(unless the model was never compiled in the first place).

Please also see [How can I install HDF5 or h5py to save my models in Keras?](#how-can-i-install-HDF5-or-h5py-to-save-my-models-in-Keras) for instructions on how to install `h5py`.
Please also see [How can I install HDF5 or h5py to save my models in Keras?](#how-can-i-install-hdf5-or-h5py-to-save-my-models-in-keras) for instructions on how to install `h5py`.

Example:

Expand Down Expand Up @@ -210,7 +210,7 @@ If you need to load weights into a *different* architecture (with some layers in
model.load_weights('my_model_weights.h5', by_name=True)
```

Please also see [How can I install HDF5 or h5py to save my models in Keras?](#how-can-i-install-HDF5-or-h5py-to-save-my-models-in-Keras) for instructions on how to install `h5py`.
Please also see [How can I install HDF5 or h5py to save my models in Keras?](#how-can-i-install-hdf5-or-h5py-to-save-my-models-in-keras) for instructions on how to install `h5py`.

For example:

Expand Down Expand Up @@ -517,7 +517,7 @@ with h5py.File('input/file.hdf5', 'r') as f:
model.predict(x_data)
```

Please also see [How can I install HDF5 or h5py to save my models in Keras?](#how-can-i-install-HDF5-or-h5py-to-save-my-models-in-Keras) for instructions on how to install `h5py`.
Please also see [How can I install HDF5 or h5py to save my models in Keras?](#how-can-i-install-hdf5-or-h5py-to-save-my-models-in-keras) for instructions on how to install `h5py`.

---

Expand Down
Loading

0 comments on commit 8ad5f3d

Please sign in to comment.