GCL icon indicating copy to clipboard operation
GCL copied to clipboard

when i run the file train_stage3_market.sh,it errors.

Open Yx1322441675 opened this issue 4 years ago • 3 comments

Epoch 1 has 10408 labeled samples of 234 ids and 2528 unlabeled samples Traceback (most recent call last): File "examples/main.py", line 381, in main() File "examples/main.py", line 151, in main main_worker(args) File "examples/main.py", line 279, in main_worker feat_nv2recon, f, f_recon, f_nv, f_nv2recon, pid, index, config, iterations) File "/home/ly/yx/GCL/gcl/trainer.py", line 112, in gen_update self.memory_loss_id = self.memory(F.normalize(f), F.normalize(f_nv), index) File "/home/ly/anaconda3/envs/GCL/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(*input, **kwargs) File "/home/ly/yx/GCL/gcl/models/memory.py", line 66, in forward negatives = torch.stack(negatives) RuntimeError: stack expects each tensor to be equal size, but got [8192] at entry 0 and [7833] at entry 3

Yx1322441675 avatar Dec 27 '21 14:12 Yx1322441675

The problem is related to clustering. It seems to me that you didn't load the pretrained weights for the identity encoder. Could you check if you saved weights from stage 2 and successfully loaded the weights to stage 3?

chenhao2345 avatar Jan 03 '22 12:01 chenhao2345

Please first check you are working on Pytorch 1.2. Some people said newer Pytorch version might raise a problem, because of the updated syntax.

chenhao2345 avatar Jan 06 '22 14:01 chenhao2345

@Yx1322441675 sorry to bother you, did this approach that said by @chenhao2345 solve your problem at ruuning?

RominaZakerian avatar Dec 30 '23 14:12 RominaZakerian