Skip to content

Commit

Permalink
Removing the tfa dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
jordancaraballo committed Oct 3, 2024
1 parent efabc41 commit c191408
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 11 deletions.
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ install_requires =
pandas
tqdm
tensorflow
tensorflow-addons
segmentation-models
xarray
rioxarray
Expand Down
3 changes: 1 addition & 2 deletions tensorflow_caney/utils/callbacks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import sys
import tensorflow as tf
import segmentation_models as sm
import tensorflow_addons as tfa
from typing import List

__all__ = ["get_callbacks"]
Expand All @@ -20,5 +19,5 @@ def get_callbacks(callbacks: List[str]) -> List:
try:
callback_functions.append(eval(callback))
except (NameError, AttributeError) as err:
sys.exit(f'{err}. Accepted callbacks from {tf}, {sm}, {tfa}')
sys.exit(f'{err}. Accepted callbacks from {tf}, {sm}')
return callback_functions
3 changes: 1 addition & 2 deletions tensorflow_caney/utils/losses.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import sys
import numpy as np
import tensorflow as tf
import tensorflow_addons as tfa
import segmentation_models as sm
import tensorflow_caney as tfc

Expand Down Expand Up @@ -31,7 +30,7 @@ def get_loss(loss: str) -> Any:
try:
loss_function = eval(loss)
except (NameError, AttributeError) as err:
sys.exit(f'{err}. Accepted loss from {tf}, {sm}, {tfa}.')
sys.exit(f'{err}. Accepted loss from {tf}, {sm}.')
return loss_function


Expand Down
3 changes: 1 addition & 2 deletions tensorflow_caney/utils/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import tensorflow as tf
from typing import Any, List
import segmentation_models as sm
import tensorflow_addons as tfa
from tensorflow.keras import backend as K
from sklearn.metrics import accuracy_score
from sklearn.metrics import precision_score
Expand Down Expand Up @@ -39,7 +38,7 @@ def get_metrics(metrics: List[str]) -> Any:
try:
metric_functions.append(eval(metric))
except (NameError, AttributeError) as err:
sys.exit(f'{err}. Accepted metrics from {tf}, {sm}, {tfa}')
sys.exit(f'{err}. Accepted metrics from {tf}, {sm}')
return metric_functions


Expand Down
3 changes: 1 addition & 2 deletions tensorflow_caney/utils/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import tensorflow as tf
import tensorflow_caney
import tensorflow_caney as tfc
import tensorflow_addons as tfa
import segmentation_models as sm
from keras_unet_collection import models as kuc

Expand Down Expand Up @@ -37,7 +36,7 @@ def get_model(model: str) -> Any:
model_function = eval(model)
except (NameError, AttributeError) as err:
sys.exit(
f'{err}. Accepted models from {tf}, {sm}, {tfa}, {tfc}, {kuc}')
f'{err}. Accepted models from {tf}, {sm}, {tfc}, {kuc}')
return model_function


Expand Down
3 changes: 1 addition & 2 deletions tensorflow_caney/utils/optimizers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import sys
import tensorflow as tf
import segmentation_models as sm
import tensorflow_addons as tfa
from typing import Any

__all__ = ["get_optimizer"]
Expand All @@ -18,5 +17,5 @@ def get_optimizer(optimizer: str) -> Any:
try:
optimizer = eval(optimizer)
except (NameError, AttributeError) as err:
sys.exit(f'{err}. Accepted optimizers from {tf}, {sm}, {tfa}')
sys.exit(f'{err}. Accepted optimizers from {tf}, {sm}')
return optimizer

0 comments on commit c191408

Please sign in to comment.