ChuHan89 / WSSS-Tissue

49 stars 8 forks source link

when n_class=2 #11

Closed sym330 closed 10 months ago

sym330 commented 10 months ago

Thank you very much for your work, if I do a split task and only include one type of defect and background, how can I change the code except n_class?

sym330 commented 10 months ago

I set the mask label as [01] and [10], with the progress of the first stage of training, Loss is getting lower and lower, and acc is also getting lower and lower, may I ask why this is? Looking forward to your reply!!!!

{'batch_size': 2, 'max_epoches': 20, 'network': 'network.resnet38_cls', 'lr': 0.01, 'num_workers': 4, 'wt_dec': 0.0005, 'session_name': 'Stage 1', 'env_name': 'PDA', 'model_name': 'PDA', 'n_class': 2, 'weights': 'init_weights/ilsvrc-cls_rna-a1_cls1000_ep-0001.params', 'trainroot': 'datasets/rust2class/train/', 'testroot': 'datasets/rust2class/test/', 'save_folder': 'checkpoints/', 'init_gama': 1, 'dataset': 'rust'} Session started: Mon Sep 11 16:58:43 2023 Epoch: 0 Iter: 100/68480 Loss:nan avg_ep_EM:0.0603 avg_ep_acc:0.0863 lr: 0.0100 Fin:Tue Sep 12 22:26:50 2023 Epoch: 0 Iter: 200/68480 Loss:nan avg_ep_EM:0.0104 avg_ep_acc:0.0155 lr: 0.0100 Fin:Tue Sep 12 22:17:50 2023 Epoch: 0 Iter: 300/68480 Loss:nan avg_ep_EM:0.0061 avg_ep_acc:0.0091 lr: 0.0100 Fin:Tue Sep 12 22:14:50 2023

sym330 commented 10 months ago

The problem has been solved, just reduce the learning rate