Tim77777767
commited on
Commit
·
c11dc36
1
Parent(s):
9659a3a
Anpassungen Config
Browse files
mix_vision_transformer_config.py
CHANGED
@@ -26,7 +26,6 @@ class MySegformerConfig(PretrainedConfig):
|
|
26 |
super().__init__(**kwargs)
|
27 |
self.embed_dims = embed_dims # einfach int behalten
|
28 |
self.in_channels = in_channels
|
29 |
-
self.embed_dims = embed_dims
|
30 |
self.num_stages = num_stages
|
31 |
self.num_layers = num_layers
|
32 |
self.num_heads = num_heads
|
@@ -41,5 +40,16 @@ class MySegformerConfig(PretrainedConfig):
|
|
41 |
self.out_indices = out_indices
|
42 |
self.num_classes = num_classes
|
43 |
|
44 |
-
# optionaler Block für Head-Config (falls
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
self.decode_head = decode_head
|
|
|
26 |
super().__init__(**kwargs)
|
27 |
self.embed_dims = embed_dims # einfach int behalten
|
28 |
self.in_channels = in_channels
|
|
|
29 |
self.num_stages = num_stages
|
30 |
self.num_layers = num_layers
|
31 |
self.num_heads = num_heads
|
|
|
40 |
self.out_indices = out_indices
|
41 |
self.num_classes = num_classes
|
42 |
|
43 |
+
# optionaler Block für Head-Config (falls decode_head nicht übergeben wurde)
|
44 |
+
if decode_head is None:
|
45 |
+
decode_head = {
|
46 |
+
"in_channels": self.embed_dims, # [32, 64, 160, 256]
|
47 |
+
"in_index": list(range(self.num_stages)),# [0, 1, 2, 3]
|
48 |
+
"channels": 256,
|
49 |
+
"dropout_ratio": 0.1,
|
50 |
+
"out_channels": self.num_classes,
|
51 |
+
"align_corners": False,
|
52 |
+
"interpolate_mode": "bilinear"
|
53 |
+
}
|
54 |
+
|
55 |
self.decode_head = decode_head
|