Skip to content

Commit

Permalink
Merge pull request #99 from keisen/features/support-for-tf2.13
Browse files Browse the repository at this point in the history
Features/support for tf2.13
  • Loading branch information
keisen authored May 16, 2023
2 parents 607a05a + 1296ee9 commit f2c65a5
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package-cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, '3.10']
python-version: [3.8, 3.9, '3.10', '3.11']
tensorflow: [current, pre]
steps:
- uses: actions/checkout@v3
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/python-package-up-to-TF2.11.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
push:
branches: [ master ]
pull_request:

env:
TF_KERAS_VIS_MAX_STEPS: 3

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, '3.10']
tensorflow: [2.6.0, 2.7.0, 2.8.0, 2.9.0, '2.10.0', '2.11.0']
exclude:
- python-version: '3.10'
tensorflow: 2.6.0
- python-version: '3.10'
tensorflow: 2.7.0
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip and Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade -e .[develop,examples] tensorflow~=${{ matrix.tensorflow }} keras~=${{ matrix.tensorflow }}
- name: Test with pytest
run: |
pytest -n auto --dist loadscope
timeout-minutes: 60
- name: Test attentions.ipynb
run: |
jupyter-nbconvert --ExecutePreprocessor.timeout=600 --to notebook --execute examples/attentions.ipynb
- name: Test visualize_dense_layer.ipynb
run: |
jupyter-nbconvert --ExecutePreprocessor.timeout=600 --to notebook --execute examples/visualize_dense_layer.ipynb
- name: Test visualize_conv_filters.ipynb
run: |
jupyter-nbconvert --ExecutePreprocessor.timeout=600 --to notebook --execute examples/visualize_conv_filters.ipynb
9 changes: 2 additions & 7 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, '3.10']
tensorflow: [2.6.0, 2.7.0, 2.8.0, 2.9.0, '2.10.0', '2.11.0']
exclude:
- python-version: '3.10'
tensorflow: 2.6.0
- python-version: '3.10'
tensorflow: 2.7.0
python-version: [3.8, 3.9, '3.10', '3.11']
tensorflow: ['2.12.0']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ title: "tf-keras-vis"
repository: "https://github.com/keisen/tf-keras-vis"
url: "https://keisen.github.io/tf-keras-vis-docs/"
type: software
version: 0.8.4
date-released: "2022-11-25"
version: 0.8.5
date-released: "2023-05-16"
license-url: "https://github.com/keisen/tf-keras-vis/blob/master/LICENSE"
references:
- authors:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ But please notice that tf-keras-vis APIs does NOT have compatibility with keras-

<!-- sec.5 -->

* Python 3.7-3.10
* tensorflow>=2.0.4
* Python 3.7+
* Tensorflow 2.0+


<!-- ./sec.5 -->
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.4
0.8.5
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Education",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
Expand Down
4 changes: 3 additions & 1 deletion tf_keras_vis/utils/model_modifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import tensorflow as tf
from packaging.version import parse as version

if version(tf.version.VERSION) >= version("2.9.0rc0"):
if version(tf.version.VERSION) >= version("2.13.0rc0"):
from keras.src.layers.convolutional.base_conv import Conv
elif version(tf.version.VERSION) >= version("2.9.0rc0"):
from keras.layers.convolutional.base_conv import Conv
elif version(tf.version.VERSION) < version("2.6.0rc0"):
from tensorflow.python.keras.layers.convolutional import Conv
Expand Down

0 comments on commit f2c65a5

Please sign in to comment.