Pytorch使训练结果可复现
在看yolov5的训练代码的时候,发现在加载模型前配置参数的时候有这么一段代码
# Configure
cuda = device.type != 'cpu'
init_seeds(2 + rank)
with open(opt.data) as f:
data_dict = yaml.load(f, Loader=yaml.FullLoader) # data dict
with torch_distributed_zero_first(rank):
原创
2021-08-26 11:45:40 ·
218 阅读 ·
0 评论