Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circle loss report errors #34

Closed
ReverseSystem001 opened this issue Aug 3, 2020 · 4 comments
Closed

Circle loss report errors #34

ReverseSystem001 opened this issue Aug 3, 2020 · 4 comments

Comments

@ReverseSystem001
Copy link

when i run Circle loss, it reports errors like bellow: Do you run it successfully?
Traceback (most recent call last):
File "train.py", line 388, in
main()
File "train.py", line 60, in main
mp.spawn(main_worker, nprocs=ngpus_per_node, args=(ngpus_per_node, cfg))
File "/usr/local/lib64/python3.6/site-packages/torch/multiprocessing/spawn.py", line 171, in spawn
while not spawn_context.join():
File "/usr/local/lib64/python3.6/site-packages/torch/multiprocessing/spawn.py", line 118, in join
raise Exception(msg)
Exception:

-- Process 1 terminated with the following error:
Traceback (most recent call last):
File "/usr/local/lib64/python3.6/site-packages/torch/multiprocessing/spawn.py", line 19, in _wrap
fn(i, *args)
File "/home/vision_rd/face_Recognition/cavaface.pytorch_bake/train.py", line 291, in main_worker
outputs = head(features, labels)
File "/usr/local/lib64/python3.6/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib64/python3.6/site-packages/torch/nn/parallel/distributed.py", line 447, in forward
output = self.module(*inputs[0], **kwargs[0])
File "/usr/local/lib64/python3.6/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/vision_rd/face_Recognition/cavaface.pytorch_bake/head/metrics.py", line 590, in forward
output = torch.logsumexp(logit_n, dim=1) + torch.logsumexp(logit_p, dim=1)
IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)

@cavalleria
Copy link
Owner

have you solved it? i have not meet this bug.

@ReverseSystem001
Copy link
Author

have you solved it? i have not meet this bug.

I have not. I will try later.

@luameows
Copy link

@cavalleria I think the function of circle loss may have some bugs, especially in the forward step. I cannot figure out why u use torch.logsumexp to compute the output feature. For nn.CrossEntropyLoss has already done Softmax already, I think u do not neeed to compute softmax again in the forward step.

@cavalleria
Copy link
Owner

@cavalleria I think the function of circle loss may have some bugs, especially in the forward step. I cannot figure out why u use torch.logsumexp to compute the output feature. For nn.CrossEntropyLoss has already done Softmax already, I think u do not neeed to compute softmax again in the forward step.

circle loss not use nn.CrossEntropyLoss, but use softplus. please refer below code.https://github.com/cavalleria/cavaface.pytorch/blob/13182ecc349ca050fa5a877045390a41037313a7/train.py#L218

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants