mahmoodlab / HIPT

Hierarchical Image Pyramid Transformer - CVPR 2022 (Oral)
Other
509 stars 89 forks source link

The results of each inference are inconsistent #59

Closed yuzhuogu closed 11 months ago

yuzhuogu commented 1 year ago

When creating heatmaps using create_hierarchical_heatmaps_indiv, the results are different each time and cannot be reproduced in the attention demo.

I have added mode.eval()

datngo93 commented 1 year ago

I faced the same problem. The reason is that the ".pth" files in the Checkpoints folder are just pointers. And thus the model was initialized with random weights instead of pretrained weights.

To solve this problem, you have to download the ".pth" files directly, and make sure you provide the correct path to those ".pth" files when creating the model. A correct model initialization will output the following:

Take key teacher in provided checkpoint dict Pretrained weights found at /path/to/.pth

Richarizardd commented 11 months ago

Thank you @v1t0ry. @yuzhuogu - please see this thread which may be helpful.