Skip to content

Commit e6334f4

Browse files
authored
feat: bump tensorflow and tensorflow probability versions (#336)
* feat: bump tensorflow and tensorflow probability versions * chore: update github flows python version * chore: update github flows python version for pull request
1 parent b7c05c2 commit e6334f4

4 files changed

Lines changed: 16 additions & 14 deletions

File tree

.github/workflows/prerelease.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
id: version
2020
run: echo ::set-output name=value::${GITHUB_REF#refs/*/}
2121

22-
- name: Setup Python 3.8
22+
- name: Setup Python 3.10
2323
uses: actions/setup-python@v5
2424
with:
25-
python-version: '3.8'
25+
python-version: '3.10'
2626

2727
- name: Install dependencies
2828
run: |

.github/workflows/pull_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v4
1919

20-
- name: Setup Python 3.8
20+
- name: Setup Python 3.10
2121
uses: actions/setup-python@v5
2222
with:
23-
python-version: '3.8'
23+
python-version: '3.10'
2424

2525
- name: Cache pip
2626
id: cache

requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
requests>=2.30, <2.31
1+
requests>=2.28, <2.31
22
pandas<3
33
numpy<2
44
scikit-learn<2
55
matplotlib<4
6-
tensorflow==2.12.0
7-
tensorflow-probability==0.19.0
6+
tensorflow==2.15.*
7+
tensorflow-probability[tf]
88
easydict==1.10
99
pmlb==1.0.*
1010
tqdm<5.0
11-
typeguard==4.0.*
11+
typeguard==4.2.*
1212
pytest==7.4.*

src/ydata_synthetic/synthesizers/saving_keras.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1+
import tensorflow.python.keras as tf_keras
2+
from keras import __version__
3+
tf_keras.__version__ = __version__
4+
15
from tensorflow.keras import Model
2-
from tensorflow.python.keras.layers import deserialize, serialize
3-
from tensorflow.python.keras.saving import saving_utils
46

57
def unpack(model, training_config, weights):
6-
restored_model = deserialize(model)
8+
restored_model = tf_keras.layers.deserialize(model)
79
if training_config is not None:
8-
restored_model.compile(**saving_utils.compile_args_from_training_config(training_config))
10+
restored_model.compile(**tf_keras.saving.saving_utils.compile_args_from_training_config(training_config))
911
restored_model.set_weights(weights)
1012
return restored_model
1113

1214
def make_keras_picklable():
1315
def __reduce__(self):
14-
model_metadata = saving_utils.model_metadata(self)
16+
model_metadata = tf_keras.saving.saving_utils.model_metadata(self)
1517
training_config = model_metadata.get("training_config", None)
16-
model = serialize(self)
18+
model = tf_keras.layers.serialize(self)
1719
weights = self.get_weights()
1820
return (unpack, (model, training_config, weights))
1921

0 commit comments

Comments
 (0)