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

correct random seed bug

上级 c3040f32
......@@ -19,7 +19,7 @@ from loss.loss import *
import cv2
import time
from datetime import datetime
import random
def trainer(ops,f_log):
try:
os.environ['CUDA_VISIBLE_DEVICES'] = ops.GPUS
......@@ -134,7 +134,7 @@ def trainer(ops,f_log):
step += 1
if epoch % 5 == 0 and epoch >0:
torch.save(model_.state_dict(), ops.model_exp + '{}-epoch-{}.pth'.format(ops.model,epoch))
set_seed(random.randint(0,65535))
except Exception as e:
print('Exception : ',e) # 打印异常
print('Exception file : ', e.__traceback__.tb_frame.f_globals['__file__'])# 发生异常所在的文件
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册