Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to tf 2.15 > #79

Merged
merged 3 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions deeplc/deeplc.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

deeplc_dir = os.path.dirname(os.path.realpath(__file__))
DEFAULT_MODELS = [
"mods/full_hc_PXD005573_mcp_1fd8363d9af9dcad3be7553c39396960.hdf5",
"mods/full_hc_PXD005573_mcp_8c22d89667368f2f02ad996469ba157e.hdf5",
"mods/full_hc_PXD005573_mcp_cb975cfdd4105f97efa0b3afffe075cc.hdf5",
"mods/full_hc_PXD005573_pub_1fd8363d9af9dcad3be7553c39396960.keras",
"mods/full_hc_PXD005573_pub_8c22d89667368f2f02ad996469ba157e.keras",
"mods/full_hc_PXD005573_pub_cb975cfdd4105f97efa0b3afffe075cc.keras",
]
DEFAULT_MODELS = [os.path.join(deeplc_dir, dm) for dm in DEFAULT_MODELS]

Expand Down Expand Up @@ -75,18 +75,18 @@
lrelu = lambda x: tf.keras.activations.relu(x, alpha=0.1, max_value=20.0)


try:
from tensorflow.compat.v1.keras.backend import set_session # noqa: F401
except ImportError:
from tensorflow.keras.backend import set_session # noqa: F401
try:
from tensorflow.compat.v1.keras.backend import clear_session
except ImportError:
from tensorflow.keras.backend import clear_session
try:
from tensorflow.compat.v1.keras.backend import get_session
except ImportError:
from tensorflow.keras.backend import get_session
# try:
# from tensorflow.compat.v1.keras.backend import set_session # noqa: F401
# except ImportError:
# from tensorflow.keras.backend import set_session # noqa: F401
# try:
# from tensorflow.compat.v1.keras.backend import clear_session
# except ImportError:
# from tensorflow.keras.backend import clear_session
# try:
# from tensorflow.compat.v1.keras.backend import get_session
# except ImportError:
# from tensorflow.keras.backend import get_session

# Set to force CPU calculations
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
Expand Down Expand Up @@ -134,10 +134,10 @@ def divide_chunks(l, n):

def reset_keras():
"""Reset Keras session."""
sess = get_session()
clear_session()
sess.close()
gc.collect()
# sess = get_session()
# clear_session()
# sess.close()
# gc.collect()
# Set to force CPU calculations
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"

Expand Down Expand Up @@ -641,7 +641,7 @@ def make_preds_core(
self.calibrate_max,
)

clear_session()
# clear_session()
gc.collect()
return ret_preds

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ keywords = [
]

dependencies = [
"tensorflow>=2.2,<2.15.0",
"tensorflow>=2.15.0,<3",
"numpy>=1.17,<2",
"pandas>=0.25,<2",
"h5py>=2.10.0,<4",
Expand Down
Loading