Yunfan-Li / Twin-Contrastive-Learning

Code for the paper "Twin Contrastive Learning for Online Clustering" (IJCV 2022)
59 stars 11 forks source link

boost运行报错 #12

Open IKOL111 opened 1 year ago

IKOL111 commented 1 year ago

您好,我更换了数据集后,train可以正常运行,但在使用boost时会产生如下报错:

RuntimeError: Expected to have finished reduction in the prior iteration before starting a new one. This error indicates that your module has parameters that were not used in producing loss. You can enable unused parameter detection by passing the keyword argument find_unused_parameters=True to torch.nn.parallel.DistributedDataParallel, and by making sure all forward function outputs participate in calculating loss. If you already have done the above, then the distributed data parallel module wasn't able to locate the output tensors i n the return value of your module's forward function. Please include the loss function and the structure of the return value of forward of your module when reporting this issue (e.g. list, dict, iterable). Parameter indices which did not receive grad for rank 0: 118 119 120 121 122 123 124 125 In addition, you can set the environment variable TORCH_DISTRIBUTED_DEBUG to either INFO or DETAIL to print out informa tion about which particular parameters did not receive gradient on this rank as part of this error ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 49172) of binary: C:\Softwa res\anaconda\envs\PyTorch1.10\python.exe

我参考了您在之前回复中说的可能未产生合格的伪标签的问题,记录了伪标签的值,训练100轮后能够产生最大值大于0.9的概率值(修改了loss中的参数,alpha=0.9,gamma=0.2),但仍然报错,请问一下您是什么原因,谢谢!

Yunfan-Li commented 1 year ago

可能是个别类别没有选出伪标签,导致CCH没有被优化到,可以查看一下当前batch下各个类别是否都有伪标签