Skip to content

Commit 8a2089f

Browse files
authored
Merge pull request #289 from nzw0301/python-312-tfkera-example
Add python 3.12 to tfkeras CI and remove warning message
2 parents 8158f46 + 49468a2 commit 8a2089f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.github/workflows/tfkeras.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
17+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
1818

1919
steps:
2020
- uses: actions/checkout@v4

tfkeras/tfkeras_simple.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from tensorflow.keras.layers import Conv2D
1717
from tensorflow.keras.layers import Dense
1818
from tensorflow.keras.layers import Flatten
19+
from tensorflow.keras.layers import Input
1920
from tensorflow.keras.models import Sequential
2021
from tensorflow.keras.optimizers import RMSprop
2122

@@ -47,13 +48,13 @@ def objective(trial):
4748
input_shape = (img_x, img_y, 1)
4849

4950
model = Sequential()
51+
model.add(Input(input_shape))
5052
model.add(
5153
Conv2D(
5254
filters=trial.suggest_categorical("filters", [32, 64]),
5355
kernel_size=trial.suggest_categorical("kernel_size", [3, 5]),
5456
strides=trial.suggest_categorical("strides", [1, 2]),
5557
activation=trial.suggest_categorical("activation", ["relu", "linear"]),
56-
input_shape=input_shape,
5758
)
5859
)
5960
model.add(Flatten())

0 commit comments

Comments
 (0)