Skip to content

Commit

Permalink
fix: update EfficientNet import issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Kohulan committed Jul 31, 2023
1 parent 664646d commit 758a0f4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion DECIMER/Efficient_Net_encoder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# EfficientNet-V2 config
import tensorflow as tf
import DECIMER.efficientnetv2 as efficientnetv2
from DECIMER.efficientnetv2 import effnetv2_model

BATCH_SIZE_DEBUG = 2
MODEL = "efficientnetv2-m" # @param
Expand All @@ -16,7 +17,7 @@ def get_efficientnetv2_backbone(
"\n...At this time we only want to use the raw "
"(no pretraining), headless, features with no pooling ...\n"
)
backbone = efficientnetv2.effnetv2_model.EffNetV2Model(model_name=model_name)
backbone = effnetv2_model.EffNetV2Model(model_name=model_name)
backbone(
tf.ones((BATCH_SIZE_DEBUG, *input_shape)), training=False, features_only=True
)
Expand Down
5 changes: 3 additions & 2 deletions DECIMER/Predictor_usingCheckpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
print(tf.__version__)

# Set GPU
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
os.environ["CUDA_VISIBLE_DEVICES"] = ""
"""
gpus = tf.config.experimental.list_physical_devices("GPU")
for gpu in gpus:
tf.config.experimental.set_memory_growth(gpu, True)

"""
# Set path
default_path = pystow.join("DECIMER-V2")

Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"pillow-heif",
"efficientnet",
"selfies",
"pyyaml",
"tensorflow-addons",
],
package_data={"DECIMER": ["repack/*.*", "efficientnetv2/*.*", "Utils/*.*"]},
Expand Down

0 comments on commit 758a0f4

Please sign in to comment.