ReID-MGN icon indicating copy to clipboard operation
ReID-MGN copied to clipboard

RuntimeError: operation does not have an identity.

Open ssbilakeri opened this issue 3 years ago • 1 comments

Hi when data set is changes Im getting below error. would you please help me to fix ths.

(base) mca@Rnd-Comp-05:~/Downloads/content/ReID-MGN-master$ python main.py --mode train --data_path /home/mca/Downloads/LTCC_ReID

epoch 1 /home/mca/anaconda3/lib/python3.7/site-packages/torch/optim/lr_scheduler.py:136: UserWarning: Detected call of lr_scheduler.step() before optimizer.step(). In PyTorch 1.1.0 and later, you should call them in the opposite order: optimizer.step() before lr_scheduler.step(). Failure to do this will result in PyTorch skipping the first value of the learning rate schedule. See more details at https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate "https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate", UserWarning) /home/mca/Downloads/content/ReID-MGN-master/utils/TripletLoss.py:31: UserWarning: This overload of addmm_ is deprecated: addmm_(Number beta, Number alpha, Tensor mat1, Tensor mat2) Consider using one of the following signatures instead: addmm_(Tensor mat1, Tensor mat2, *, Number beta, Number alpha) (Triggered internally at /pytorch/torch/csrc/utils/python_arg_parser.cpp:882.) dist.addmm_(1, -2, inputs, inputs.t()) total loss:16.37 Triplet_Loss :2.75 CrossEntropy_Loss:6.81 Traceback (most recent call last): File "main.py", line 155, in main.train() File "main.py", line 48, in train loss = self.loss(outputs, labels) File "/home/mca/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "/home/mca/Downloads/content/ReID-MGN-master/loss.py", line 14, in forward Triplet_Loss = [triplet_loss(output, labels) for output in outputs[1:4]] File "/home/mca/Downloads/content/ReID-MGN-master/loss.py", line 14, in Triplet_Loss = [triplet_loss(output, labels) for output in outputs[1:4]] File "/home/mca/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "/home/mca/Downloads/content/ReID-MGN-master/utils/TripletLoss.py", line 38, in forward dist_an.append(dist[i][mask[i] == 0].min().unsqueeze(0)) RuntimeError: operation does not have an identity.

ssbilakeri avatar May 19 '21 10:05 ssbilakeri