You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @LX-doctorAI1 ,
Thank you for sharing this code.
I met this error during training. It seems that it occurs when 'n=0'.
Could you give some advice?
Thank you in advance!
0%| | 0/13409 [00:02<?, ?it/s]
Traceback (most recent call last):
File "main.py", line 57, in
main()
File "main.py", line 52, in main
trainer.train()
File "/apdcephfs_cq2/share_916081/jarviswang/wt/code/medical_report_gen/M2KT/modules/trainer.py", line 67, in train
result = self._train_epoch(epoch)
File "/apdcephfs_cq2/share_916081/jarviswang/wt/code/medical_report_gen/M2KT/modules/trainer.py", line 285, in _train_epoch
loss = self.criterion(*((outputs[0],) + (reports_ids, reports_masks, labels) + outputs[1:] + (self.args,)))
File "/apdcephfs_cq2/share_916081/jarviswang/wt/code/medical_report_gen/M2KT/modules/loss.py", line 68, in compute_loss
match_loss = ranking_loss(z_img, z_txt, labels, similarity_function)
File "/usr/local/lib64/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/apdcephfs_cq2/share_916081/jarviswang/wt/code/medical_report_gen/M2KT/modules/loss.py", line 78, in forward
return self.imposter_img_loss(z_image, z_text, labels, similarity_function) +
File "/apdcephfs_cq2/share_916081/jarviswang/wt/code/medical_report_gen/M2KT/modules/loss.py", line 103, in imposter_img_loss
margin = max(0.5, diff / n)
ZeroDivisionError: division by zero
The text was updated successfully, but these errors were encountered:
Hi @LX-doctorAI1 ,
Thank you for sharing this code.
I met this error during training. It seems that it occurs when 'n=0'.
Could you give some advice?
Thank you in advance!
0%| | 0/13409 [00:02<?, ?it/s]
Traceback (most recent call last):
File "main.py", line 57, in
main()
File "main.py", line 52, in main
trainer.train()
File "/apdcephfs_cq2/share_916081/jarviswang/wt/code/medical_report_gen/M2KT/modules/trainer.py", line 67, in train
result = self._train_epoch(epoch)
File "/apdcephfs_cq2/share_916081/jarviswang/wt/code/medical_report_gen/M2KT/modules/trainer.py", line 285, in _train_epoch
loss = self.criterion(*((outputs[0],) + (reports_ids, reports_masks, labels) + outputs[1:] + (self.args,)))
File "/apdcephfs_cq2/share_916081/jarviswang/wt/code/medical_report_gen/M2KT/modules/loss.py", line 68, in compute_loss
match_loss = ranking_loss(z_img, z_txt, labels, similarity_function)
File "/usr/local/lib64/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/apdcephfs_cq2/share_916081/jarviswang/wt/code/medical_report_gen/M2KT/modules/loss.py", line 78, in forward
return self.imposter_img_loss(z_image, z_text, labels, similarity_function) +
File "/apdcephfs_cq2/share_916081/jarviswang/wt/code/medical_report_gen/M2KT/modules/loss.py", line 103, in imposter_img_loss
margin = max(0.5, diff / n)
ZeroDivisionError: division by zero
The text was updated successfully, but these errors were encountered: