-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
41 lines (32 loc) · 933 Bytes
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2021/11/21 10:23
# @Author : Jack Zhao
# @Site :
# @File : config.py
# @Software: PyCharm
# #Desc: 这里的config针对focal loss,单元测试记得修改model中对应的config
import warnings
class Config:
GPU_USED = True
LR = 0.004
WEIGHT_DECAY = 1e-3 # 正则化
BATCH_SIZE = 128
EPOCHES = 30
LOG_FREQ = 30
# WEIGHTS = r"E:/Code/Pycharm/JOC/result/focal/"
WEIGHTS = r'/data/JOC/result/focal/'
DATASET = 'let'
def parse(self, kwargs):
for k, v in kwargs.items():
if not hasattr(self, k):
warnings.warn("Warning: opt has not attribute %s" % k)
setattr(self, k, v)
print('user config:')
for k, v in self.__class__.__dict__.items():
if not k.startswith("__"):
print(k, getattr(self, k))
Config.parse = parse
opt = Config()
if __name__ == '__main__':
pass