Skip to content

Commit

Permalink
a few changes here to get compatible with tf 2.15 (#56)
Browse files Browse the repository at this point in the history
hopefully pushing tag v1.0.6 as well
  • Loading branch information
andrewkern authored May 9, 2024
1 parent 42dd4c9 commit 3fdc617
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions diploshic/diploSHIC
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ if argsDict["mode"] in ["train", "predict"]:
from keras.layers import Dense, Dropout, Activation, Flatten, Input
from keras.layers import Conv2D, MaxPooling2D, concatenate
from sklearn.model_selection import train_test_split
from keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from keras.callbacks import EarlyStopping, ModelCheckpoint
import keras.backend as K
import fnmatch
Expand Down Expand Up @@ -495,7 +495,7 @@ if argsDict["mode"] == "train":
model_json = model.to_json()
with open(outputModel + ".json", "w") as json_file:
json_file.write(model_json)
modWeightsFilepath = outputModel + ".weights.hdf5"
modWeightsFilepath = outputModel + ".weights.h5"
checkpoint = ModelCheckpoint(
modWeightsFilepath,
monitor="val_accuracy",
Expand All @@ -514,16 +514,16 @@ if argsDict["mode"] == "train":
start = time.time()
model.fit(
datagen.flow(X_train, Y_train, batch_size=32),
steps_per_epoch=len(X_train) / 32,
steps_per_epoch=int(len(X_train) / 32),
epochs=epochOption,
verbose=1,
callbacks=callbacks_list,
validation_data=validation_gen.flow(X_valid, Y_valid, batch_size=32),
validation_steps=len(X_test) / 32,
validation_steps=int(len(X_test) / 32),
)
# model.fit(X_train, Y_train, batch_size=32, epochs=100,validation_data=(X_test,Y_test),callbacks=callbacks_list, verbose=1)
score = model.evaluate(
test_gen.flow(X_test, Y_test, batch_size=32), steps=len(Y_test) / 32
test_gen.flow(X_test, Y_test, batch_size=32), steps=int(len(Y_test) / 32)
)
sys.stderr.write(
"total time spent fitting and evaluating: %f secs\n"
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"diploshic/utils.c"],
)
setup(name='diploSHIC',
version='1.0.5',
version='1.0.6',
description='diploSHIC',
long_description=long_description,
long_description_content_type="text/markdown",
Expand All @@ -24,7 +24,7 @@
'pandas',
'scikit-allel',
'scikit-learn',
'tensorflow',
'tensorflow==2.15.0',
'keras'],
scripts=['diploshic/diploSHIC',
'diploshic/makeFeatureVecsForChrArmFromVcfDiploid.py',
Expand Down

0 comments on commit 3fdc617

Please sign in to comment.