项目复现设定随机种子 ###在程序运行开始期间加入下列代码 seed = 3 ### 自己设定 random.seed(seed) ###规定python的初始化随机数 np.random.seed(seed) ### 规定numpy初始化随机数 torch.manual_seed(seed) ### 规定卷积操作中的初始化随机数 torch.backends.cudnn.deterministic = True torch.backends.cudnn.benchmark = False