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

ZeroDivisionError: division by zero #27

Open
s5377689 opened this issue Jul 30, 2023 · 0 comments
Open

ZeroDivisionError: division by zero #27

s5377689 opened this issue Jul 30, 2023 · 0 comments

Comments

@s5377689
Copy link

s5377689 commented Jul 30, 2023

ZeroDivisionError Traceback (most recent call last)
in
69 # Compute training statistics
70 epoch_loss = float(np.mean(epoch_loss))
---> 71 ASR_TOG = score_adv / num_rois
72 ASR_Rand = score_rand / num_rois
73

ZeroDivisionError: division by zero

##############################
##############################
##############################

If some images fail to detect objects

Is this modification correct?

##############################
##############################
##############################

Compute training statistics

epoch_loss = float(np.mean(epoch_loss))
###########################################code i added
+     if num_rois > 0:
+          ASR_TOG = score_adv / num_rois
+         ASR_Rand = score_rand / num_rois
+     else:
+         ASR_TOG = 0.0
+         ASR_Rand = 0.0
    ###########################################code i added
    ASR_TOG = score_adv / num_rois
    ASR_Rand = score_rand / num_rois
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

1 participant