Skip to content

Commit aa5c2b2

Browse files
author
yarden-sony
committed
delete FOUND_SONY_CUSTOM_LAYERS
1 parent d1900e6 commit aa5c2b2

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

model_compression_toolkit/target_platform_capabilities/targetplatform2framework/attach2keras.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@
1919
from model_compression_toolkit.target_platform_capabilities.targetplatform2framework import LayerFilterParams
2020
from model_compression_toolkit.target_platform_capabilities.targetplatform2framework.attach2fw import \
2121
AttachTpcToFramework
22-
from model_compression_toolkit.verify_packages import FOUND_SONY_CUSTOM_LAYERS
2322

24-
if FOUND_SONY_CUSTOM_LAYERS:
25-
from sony_custom_layers.keras.object_detection.ssd_post_process import SSDPostProcess
23+
from sony_custom_layers.keras.object_detection.ssd_post_process import SSDPostProcess
2624

2725
if version.parse(tf.__version__) >= version.parse("2.13"):
2826
from keras.src.layers import Conv2D, DepthwiseConv2D, Dense, Reshape, ZeroPadding2D, Dropout, \
@@ -105,13 +103,7 @@ def __init__(self):
105103
OperatorSetNames.L2NORM: [tf.math.l2_normalize],
106104
}
107105

108-
if FOUND_SONY_CUSTOM_LAYERS:
109-
self._opset2layer[OperatorSetNames.SSD_POST_PROCESS] = [SSDPostProcess]
110-
else:
111-
# If Custom layers is not installed then we don't want the user to fail, but just ignore custom layers
112-
# in the initialized framework TPC
113-
self._opset2layer[OperatorSetNames.SSD_POST_PROCESS] = []
114-
106+
self._opset2layer[OperatorSetNames.SSD_POST_PROCESS] = [SSDPostProcess]
115107
self._opset2attr_mapping = {
116108
OperatorSetNames.CONV: {
117109
KERNEL_ATTR: DefaultDict(default_value=KERAS_KERNEL),

model_compression_toolkit/verify_packages.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,3 @@
3030
FOUND_TORCHVISION = importlib.util.find_spec("torchvision") is not None
3131
FOUND_ONNX = importlib.util.find_spec("onnx") is not None
3232
FOUND_ONNXRUNTIME = importlib.util.find_spec("onnxruntime") is not None
33-
FOUND_SONY_CUSTOM_LAYERS = importlib.util.find_spec('sony_custom_layers') is not None

0 commit comments

Comments
 (0)