Skip to content

Commit bd83701

Browse files
committed
reformat
1 parent 7ab25c5 commit bd83701

7 files changed

Lines changed: 11 additions & 10 deletions

File tree

keras_cv_attention_models/backend.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@
2929

3030
is_tf_use_legacy_keras = os.environ.get("TF_USE_LEGACY_KERAS", "0") == "1"
3131
if int(tf_version[0]) >= 2 and int(tf_version[1]) >= 16 and int(tf_keras_version[0]) >= 3:
32-
print("[WARNING] Currently tensorflow>=2.16 with keras 3 not supported, try pip install tf-keras~=2.16 and set TF_USE_LEGACY_KERAS=1 if error.")
32+
suggest = ".".join(tf_version[:2])
33+
print(
34+
f"[WARNING] Currently tensorflow>=2.16 with keras 3 not supported, try pip install tf-keras~={suggest} and set TF_USE_LEGACY_KERAS=1 if error."
35+
)
3336
elif int(tf_version[0]) >= 2 and int(tf_version[1]) >= 16 and not is_tf_use_legacy_keras:
3437
os.environ["TF_USE_LEGACY_KERAS"] = "1"
3538
print("[WARNING] Setting TF_USE_LEGACY_KERAS=1. Make sure this is ahead of importing tensorflow or keras.")

keras_cv_attention_models/clip/tokenizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" CLIP tokenizer
1+
"""CLIP tokenizer
22
33
Copied from https://github.com/mlfoundations/open_clip/blob/main/src/open_clip/tokenizer.py
44
Copied from https://github.com/openai/CLIP. Originally MIT License, Copyright (c) 2021 OpenAI.

keras_cv_attention_models/download_and_load.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ def reload_model_weights(
5454
file_name = os.path.basename(url)
5555
try:
5656
pretrained_model = backend.get_file(file_name, url, cache_subdir="models", file_hash=cur_file_hash)
57-
except:
58-
print("[Error] will not load weights, url not found or download failed:", url)
57+
except Exception as ee:
58+
print(f"[Error] will not load weights, url not found or download failed. Error message: {ee}, url: {url}")
5959
return None
6060
else:
6161
print(">>>> Load pretrained from:", pretrained_model)

keras_cv_attention_models/efficientnet/efficientnet_edgetpu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" Creates an EfficientNet-EdgeTPU model
1+
"""Creates an EfficientNet-EdgeTPU model
22
Ref impl: https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet/edgetpu
33
"""
44

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.4.2"
1+
__version__ = "1.4.3"

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
""" Setup
2-
"""
1+
"""Setup"""
32

43
from setuptools import setup, find_packages
54
from codecs import open

setup_kecam.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
""" Setup
2-
"""
1+
"""Setup"""
32

43
from setuptools import setup, find_packages
54
from codecs import open

0 commit comments

Comments
 (0)