ucbdrive / hd3

Code for Hierarchical Discrete Distribution Decomposition for Match Density Estimation (CVPR 2019)
BSD 3-Clause "New" or "Revised" License
204 stars 31 forks source link

output tensors differ when parsing exactly same input #23

Closed amaanda closed 4 years ago

amaanda commented 4 years ago
output1 = model(img_list=resized_img_list,label_list=label_list,get_vect=True, get_prob=True,get_epe=args.evaluate)
output2 = model(img_list=resized_img_list,label_list=label_list,get_vect=True, get_prob=True,get_epe=args.evaluate)
print("Equals: ", torch.equal(output1['vect'], output2['vect']))

prints

False

Is there some probabilistic layer on the network?

yzcjtr commented 4 years ago

Yes. Some PyTorch ops are non-deterministic (e.g. torch.tensor.scatteradd). If you fix all the random seeds for Python and PyTorch, you will get identical results.