Skip to content

Commit

Permalink
update kt install
Browse files Browse the repository at this point in the history
  • Loading branch information
haifeng-jin committed Jun 22, 2020
1 parent 9047ac8 commit 75bf6fd
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 17 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
run: |
python -m pip install --upgrade pip setuptools
pip install git+https://github.com/gabrieldemarmiesse/[email protected]
pip install git+https://github.com/keras-team/[email protected]
pip install -e .[tests] --progress-bar off
pip install twine
- name: Lint
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install git+https://github.com/keras-team/[email protected]
pip install -e .[tests] --progress-bar off
- name: Test with pytest
run: |
Expand Down Expand Up @@ -46,6 +47,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install git+https://github.com/keras-team/[email protected]
pip install -e .
pip install -r docs/requirements.txt
- name: Build the docs
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ For detailed tutorial, please check [here](https://autokeras.com/tutorial/overvi
To install the package, please use the `pip` installation as follows:

```shell
pip3 install autokeras
pip3 install git+https://github.com/keras-team/[email protected]
pip3 install autokeras==1.0.3
```

Please follow the [installation guide](https://autokeras.com/install) for more details.

**Note:** Currently, AutoKeras is only compatible with **Python >= 3.5** and **TensorFlow >= 2.1.0**.
**Note:** Currently, AutoKeras is only compatible with **Python >= 3.5** and **TensorFlow >= 2.2.0**.

## Community
<p float="left">
Expand Down
5 changes: 4 additions & 1 deletion autokeras/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
from autokeras.tuners import Greedy
from autokeras.tuners import Hyperband
from autokeras.tuners import RandomSearch
from autokeras.utils.utils import check_kt_version
from autokeras.utils.utils import check_tf_version

__version__ = '1.0.3rc0'
__version__ = '1.0.3'

check_tf_version()
check_kt_version()
25 changes: 19 additions & 6 deletions autokeras/utils/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import re

import kerastuner
import tensorflow as tf
from packaging.version import parse
from tensorflow.python.util import nest
Expand Down Expand Up @@ -42,19 +43,31 @@ def to_type_key(dictionary, convert_func):


def check_tf_version() -> None:
if parse(tf.__version__) < parse('2.1.0'):
if parse(tf.__version__) < parse('2.2.0'):
raise ImportError(
'The Tensorflow package version needs to be at least v2.1.0 \n'
'The Tensorflow package version needs to be at least 2.2.0 \n'
'for AutoKeras to run. Currently, your TensorFlow version is \n'
'v{version}. Please upgrade with \n'
'`$ pip install --upgrade tensorflow` -> GPU version \n'
'or \n'
'`$ pip install --upgrade tensorflow-cpu` -> CPU version. \n'
'{version}. Please upgrade with \n'
'`$ pip install --upgrade tensorflow`. \n'
'You can use `pip freeze` to check afterwards that everything is '
'ok.'.format(version=tf.__version__)
)


def check_kt_version() -> None:
if parse(kerastuner.__version__) < parse('1.0.2rc0'):
raise ImportError(
'The Keras Tuner package version needs to be at least 1.0.2rc0 \n'
'for AutoKeras to run. Currently, your Keras Tuner version is \n'
'{version}. Please upgrade with \n'
'`$ pip install '
'git+https://github.com/keras-team/[email protected]'
'#egg=keras-tuner-1.0.2rc0`. \n'
'You can use `pip freeze` to check afterwards that everything is '
'ok.'.format(version=kerastuner.__version__)
)


def save_json(path, obj):
obj = json.dumps(obj)
with tf.io.gfile.GFile(path, 'w') as f:
Expand Down
8 changes: 5 additions & 3 deletions docs/templates/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

**Pip**: Follow the TensorFlow install steps to install Pip.

**Tensorflow >= 2.1.0**: AutoKeras is based on TensorFlow.
**Tensorflow >= 2.2.0**: AutoKeras is based on TensorFlow.
Please follow
[this tutorial](https://www.tensorflow.org/install/pip) to install TensorFlow for python3.

Expand All @@ -17,12 +17,14 @@ AutoKeras only support **Python 3**.
If you followed previous steps to use virtualenv to install tensorflow,
you can just activate the virtualenv and use the following command to install AutoKeras.
```
pip install autokeras
pip install git+https://github.com/keras-team/[email protected]
pip install autokeras==1.0.3
```

If you did not use virtualenv, and you use `python3` command to execute your python program,
please use the following command to install AutoKeras.
```
python3 -m pip install autokeras
python3 -m pip install git+https://github.com/keras-team/[email protected]
python3 -m pip install autokeras==1.0.3
```

7 changes: 2 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

setup(
name='autokeras',
version='1.0.3rc0',
version='1.0.3',
description='AutoML for deep learning',
package_data={'': ['README.md']},
long_description=readme.read_text(encoding='utf-8'),
long_description_content_type='text/markdown',
author='Data Analytics at Texas A&M (DATA) Lab, Keras Team',
author_email='[email protected]',
url='http://autokeras.com',
download_url='https://github.com/keras-team/autokeras/archive/1.0.3rc0.tar.gz',
download_url='https://github.com/keras-team/autokeras/archive/1.0.3.tar.gz',
keywords=['AutoML', 'Keras'],
install_requires=[
'packaging',
Expand All @@ -25,9 +25,6 @@
'numpy',
'pandas',
],
dependency_links=[
'https://github.com/keras-team/[email protected]#egg=keras-tuner-1.0.2rc0',
],
extras_require={
'tests': ['pytest>=4.4.0',
'flake8',
Expand Down

0 comments on commit 75bf6fd

Please sign in to comment.