ChuHan89 / WSSS-Tissue

49 stars 8 forks source link

About stage1 #8

Open Le312 opened 2 years ago

Le312 commented 2 years ago

Hi, I was training the model in the first step and when I got to 60 left in the training, a warning appeared as follows: Epoch:19 Iter:16600/16660 Loss:nan avg_ep_EM:0.0000 avg_ep_acc:0.0000 lr: 0.0001 Fin:Fri Jul 15 23:12:01 2022 Gama of progressive dropouput attention is: 0.6676079717550942 /home/xmulsm/lsj/WSSS-Tissue-main/tool/iouutils.py:31: RuntimeWarning: invalid value encountered in double_scalars acc = np.diag(hist).sum() / hist.sum() /home/xmulsm/lsj/WSSS-Tissue-main/tool/iouutils.py:32: RuntimeWarning: invalid value encountered in true_divide acc_cls = np.diag(hist)[0:4] / hist.sum(axis=1)[0:4] /home/xmulsm/lsj/WSSS-Tissue-main/tool/iouutils.py:33: RuntimeWarning: Mean of empty slice acc_cls = np.nanmean(acc_cls) /home/xmulsm/lsj/WSSS-Tissue-main/tool/iouutils.py:34: RuntimeWarning: invalid value encountered in true_divide iu = np.diag(hist)[0:4] / ((hist.sum(axis=1) + hist.sum(axis=0) - np.diag(hist))[0:4]) #true和pred都没有,则nan;true有pred没有或者true没有pred有,则zero /home/xmulsm/lsj/WSSS-Tissue-main/tool/iouutils.py:35: RuntimeWarning: Mean of empty slice mean_iu = np.nanmean(iu) #gt中有的其实就不会存在nan了 /home/xmulsm/lsj/WSSS-Tissue-main/tool/iouutils.py:36: RuntimeWarning: invalid value encountered in true_divide freq = hist.sum(axis=1)[0:4] / hist.sum() #groundtrue中每一个类的占比 {'Pixel Accuracy': nan, 'Mean Accuracy': nan, 'Frequency Weighted IoU': 0.0, 'Mean IoU': nan, 'Class IoU': {0: nan, 1: nan, 2: nan, 3: nan}} And I can't generate log files, did you encounter this problem during training? Thank you!

linjiatai commented 2 years ago

Hi, I was training the model in the first step and when I got to 60 left in the training, a warning appeared as follows: Epoch:19 Iter:16600/16660 Loss:nan avg_ep_EM:0.0000 avg_ep_acc:0.0000 lr: 0.0001 Fin:Fri Jul 15 23:12:01 2022 Gama of progressive dropouput attention is: 0.6676079717550942 /home/xmulsm/lsj/WSSS-Tissue-main/tool/iouutils.py:31: RuntimeWarning: invalid value encountered in double_scalars acc = np.diag(hist).sum() / hist.sum() /home/xmulsm/lsj/WSSS-Tissue-main/tool/iouutils.py:32: RuntimeWarning: invalid value encountered in true_divide acc_cls = np.diag(hist)[0:4] / hist.sum(axis=1)[0:4] /home/xmulsm/lsj/WSSS-Tissue-main/tool/iouutils.py:33: RuntimeWarning: Mean of empty slice acc_cls = np.nanmean(acc_cls) /home/xmulsm/lsj/WSSS-Tissue-main/tool/iouutils.py:34: RuntimeWarning: invalid value encountered in true_divide iu = np.diag(hist)[0:4] / ((hist.sum(axis=1) + hist.sum(axis=0) - np.diag(hist))[0:4]) #true和pred都没有,则nan;true有pred没有或者true没有pred有,则zero /home/xmulsm/lsj/WSSS-Tissue-main/tool/iouutils.py:35: RuntimeWarning: Mean of empty slice mean_iu = np.nanmean(iu) #gt中有的其实就不会存在nan了 /home/xmulsm/lsj/WSSS-Tissue-main/tool/iouutils.py:36: RuntimeWarning: invalid value encountered in true_divide freq = hist.sum(axis=1)[0:4] / hist.sum() #groundtrue中每一个类的占比 {'Pixel Accuracy': nan, 'Mean Accuracy': nan, 'Frequency Weighted IoU': 0.0, 'Mean IoU': nan, 'Class IoU': {0: nan, 1: nan, 2: nan, 3: nan}} And I can't generate log files, did you encounter this problem during training? Thank you!

Thanks for your attention to our work. We have tested our code again and there is no problem in the training phase of stage 1. Maybe, your setting of args.dataset, args.trainroot and args.testroot did not match. We have provided an example for our code at run_pipeline.sh.

In addition, we save the xxx.log files by terminal redirection such as "python xxx.py >> xxx.log". We also provide a visual record by the visdom tool. You should launch visdom before running our code.

xielaobanyy commented 1 year ago

I found the same problem when I reproduced stage1. It should be that there is a problem with the path of the test set in the original sample code. The path of the test set should be ''datasets/LUAD-HistoSeg/test/'' instead of "dataset/LUAD -HistoSeg/test/", You can refer to what I said. WeChat 圖片_20230604150542