提交 e072d048 编写于 作者: Eric.Lee2021's avatar Eric.Lee2021 🚴🏻

correct epoch random seed bug

上级 fb7351f4
......@@ -28,7 +28,7 @@ import cv2
import time
import json
from datetime import datetime
import random
def trainer(ops,f_log):
try:
os.environ['CUDA_VISIBLE_DEVICES'] = ops.GPUS
......@@ -164,6 +164,7 @@ def trainer(ops,f_log):
optimizer.zero_grad()
step += 1
set_seed(random.randint(0,65535))
torch.save(model_.state_dict(), ops.model_exp + '{}-size-{}-loss-{}-model_epoch-{}.pth'.format(ops.model,ops.img_size[0],ops.loss_define,epoch))
except Exception as e:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册