Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace deprecated name_scope with name
Browse files Browse the repository at this point in the history
alphasentaurii committed May 10, 2024
1 parent e02952a commit 465bbb7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spacekit/builder/architect.py
Original file line number Diff line number Diff line change
@@ -327,7 +327,7 @@ def set_callbacks(self, patience=15):
list
[callbacks.ModelCheckpoint, callbacks.EarlyStopping]
"""
model_name = str(self.model.name_scope().rstrip("/"))
model_name = str(self.model.name)
checkpoint_cb = callbacks.ModelCheckpoint(
f"{model_name}_checkpoint.h5", save_best_only=True
)
@@ -361,7 +361,7 @@ def save_model(self, weights=True, output_path=".", keras_archive=True, parent_d
save model using new (preferred) keras archive format, by default True
"""
if self.name is None:
self.name = str(self.model.name_scope().rstrip("/"))
self.name = str(self.model.name)
datestamp = dt.datetime.now().isoformat().split("T")[0]
model_name = f"{self.name}_{datestamp}"
else:
@@ -439,7 +439,7 @@ def batch_fit(self):
tf.keras.model.history
Keras training history
"""
model_name = str(self.model.name_scope().rstrip("/").upper())
model_name = str(self.model.name).upper()
self.log.info("FITTING MODEL...")
validation_data = (
(self.X_test, self.y_test) if self.X_test is not None else None
@@ -482,7 +482,7 @@ def fit(self, params=None):
"""
if params is not None:
self.fit_params(**params)
model_name = str(self.model.name_scope().rstrip("/").upper())
model_name = str(self.model.name).upper()
self.log.info("FITTING MODEL...")
validation_data = (
(self.X_test, self.y_test) if self.X_test is not None else None

0 comments on commit 465bbb7

Please sign in to comment.