chenqi1126 / SIPE

[CVPR 2022] Self-supervised Image-specific Prototype Exploration for Weakly Supervised Semantic Segmentation
MIT License
73 stars 10 forks source link

实验问题 #4

Closed Elaineok closed 2 years ago

Elaineok commented 2 years ago
        # if (optimizer.global_step-1)% 500 == 0 and optimizer.global_step > 10:
        #     miou = validate(model, val_data_loader)
        #     torch.save({'net':model.module.state_dict()}, os.path.join("sess", 'ckpt', 'iter_' + str(optimizer.global_step) + '.pth'))
        #
        #     if miou > bestiou:
        #         bestiou = miou
        #         torch.save({'net':model.module.state_dict()}, os.path.join("sess", 'ckpt', 'best.pth'))

torch.save({'net':model.module.state_dict()}, os.path.join("sess", 'ckpt', 'final.pth'))
torch.cuda.empty_cache()

为什么我把上面代码注释掉,也就是不保存每次迭代结果和best.pth,单纯保存最终'final.pth',得到结果会下降到58.25%呢?

chenqi1126 commented 2 years ago

每次训练结果小范围波动属于正常现象,与这段代码无关。