This commit is contained in:
thanhvc3 2024-04-27 10:26:58 +07:00
parent 6ec566505f
commit 63ccb4ec75
2 changed files with 17 additions and 15 deletions

30
main.py
View File

@ -716,17 +716,19 @@ if __name__ == "__main__":
model.load_model(save_path) model.load_model(save_path)
model.evaluate('test') model.evaluate('test')
else: else:
while True: model = Main(args, logger)
try: model.fit()
model = Main(args, logger) # while True:
model.fit() # try:
except Exception as e: # model = Main(args, logger)
print(e) # model.fit()
traceback.print_exc() # except Exception as e:
try: # print(e)
del model # traceback.print_exc()
except Exception: # try:
pass # del model
time.sleep(30) # except Exception:
continue # pass
break # time.sleep(30)
# continue
# break

View File

@ -862,7 +862,7 @@ class PoolFormerBlock(nn.Module):
self.norm1 = norm_layer(dim) self.norm1 = norm_layer(dim)
#self.token_mixer = Pooling(pool_size=pool_size) #self.token_mixer = Pooling(pool_size=pool_size)
# self.token_mixer = FNetBlock() # self.token_mixer = FNetBlock()
self.token_mixer = WindowAttention(dim=dim, window_size=to_2tuple(7), num_heads=3, pretrained_window_size=[5,5]) self.token_mixer = WindowAttention(dim=dim, window_size=to_2tuple(7), num_heads=1, pretrained_window_size=[5,5])
self.norm2 = norm_layer(dim) self.norm2 = norm_layer(dim)
mlp_hidden_dim = int(dim * mlp_ratio) mlp_hidden_dim = int(dim * mlp_ratio)
self.mlp = Mlp(in_features=dim, hidden_features=mlp_hidden_dim, self.mlp = Mlp(in_features=dim, hidden_features=mlp_hidden_dim,