Skip to content

Commit

Permalink
Merge pull request #79 from compomics/tf_latest
Browse files Browse the repository at this point in the history
Update to tf 2.15 >
  • Loading branch information
RobbinBouwmeester authored Aug 8, 2024
2 parents bc31c7a + 20a3b7a commit e9d3061
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
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

0 comments on commit e9d3061

Please sign in to comment.