为什么nn.MaxPool2d会让深度学习结果在GPU上不能复现,而在CPU上可以复现,我的torch版本为2.0.1+cu118,且设定了随机数种子如下: def…
- User
为什么nn.MaxPool2d会让深度学习结果在GPU上不能复现,而在CPU上可以复现,我的torch版本为2.0.1+cu118,且设定了随机数种子如下: def seed_torch(seed): random.seed(seed) os.environ['PYTHONHASHSEED'] = str(seed) np.random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed(seed) # torch.cuda.manual_seed_all(seed) # if you are using multi-GPU. torch.backends.cudnn.benchmark = False torch.backends.cudnn.deterministic = True torch.set_float32_matmul_precision('high') # PyTorch 1.12+ os.environ["CUBLAS_WORKSPACE_CONFIG"] = ":4096:8"
seed_torch(seed=opt.seed)
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.