Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -42,17 +42,19 @@ class FixedInputLayer(InputLayer):
|
|
| 42 |
del kwargs['dtype']
|
| 43 |
super().__init__(**kwargs)
|
| 44 |
|
| 45 |
-
# 3. Xử lý Augmentation Layers (Xử lý lỗi: data_format &
|
| 46 |
def fix_augmentation_layer(LayerClass):
|
| 47 |
class FixedLayer(LayerClass):
|
| 48 |
def __init__(self, **kwargs):
|
| 49 |
-
#
|
| 50 |
-
|
| 51 |
-
|
|
|
|
|
|
|
| 52 |
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
|
| 57 |
super().__init__(**kwargs)
|
| 58 |
return FixedLayer
|
|
|
|
| 42 |
del kwargs['dtype']
|
| 43 |
super().__init__(**kwargs)
|
| 44 |
|
| 45 |
+
# 3. Xử lý Augmentation Layers (Xử lý lỗi: data_format, dtype & value_range)
|
| 46 |
def fix_augmentation_layer(LayerClass):
|
| 47 |
class FixedLayer(LayerClass):
|
| 48 |
def __init__(self, **kwargs):
|
| 49 |
+
# Danh sách các tham số gây lỗi tương thích giữa Keras 3 và 2
|
| 50 |
+
# 'value_range': Gây lỗi ở RandomContrast
|
| 51 |
+
# 'data_format': Gây lỗi ở RandomFlip
|
| 52 |
+
# 'dtype': Gây lỗi DTypePolicy
|
| 53 |
+
ignore_keys = ['data_format', 'dtype', 'value_range']
|
| 54 |
|
| 55 |
+
for key in ignore_keys:
|
| 56 |
+
if key in kwargs:
|
| 57 |
+
del kwargs[key]
|
| 58 |
|
| 59 |
super().__init__(**kwargs)
|
| 60 |
return FixedLayer
|