随机数种子

This commit is contained in:
2023-03-01 02:53:47 +08:00
parent a8d597ea6d
commit fa1a244944

View File

@@ -253,6 +253,7 @@ def main_dev(opt):
while True:
for task in get_tasks(): # 遍历 tasks 返回 dict
print('task:', task) # 打印任务
seed_everything(task['seed']) # 设置随机种子
# 如果模型不同,重新加载模型(注意释放内存)
if task['ckpt'] != model_name:
@@ -314,8 +315,8 @@ def main_dev(opt):
# x
start_code = None
if task['seed']: #if opt.fixed_code:
start_code = torch.randn([task['seed'], opt.C, opt.H // opt.f, opt.W // opt.f], device=device)
if opt.fixed_code:
start_code = torch.randn([task['number'], opt.C, opt.H // opt.f, opt.W // opt.f], device=device)
print("start_code:", start_code)
# 更新进度