cang1602004 commited on
Commit
ecce039
·
verified ·
1 Parent(s): 7fd0239

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
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 & dtype policy)
46
  def fix_augmentation_layer(LayerClass):
47
  class FixedLayer(LayerClass):
48
  def __init__(self, **kwargs):
49
- # Xóa tham số data_format gây lỗi
50
- if 'data_format' in kwargs:
51
- del kwargs['data_format']
 
 
52
 
53
- # Xóa tham số dtype gây lỗi (DTypePolicy)
54
- if 'dtype' in kwargs:
55
- del kwargs['dtype']
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