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

rep_crop ZeroDivisionError #207

Open
AhmetCanSolak opened this issue Jun 28, 2022 · 0 comments
Open

rep_crop ZeroDivisionError #207

AhmetCanSolak opened this issue Jun 28, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@AhmetCanSolak
Copy link
Collaborator

Describe the bug
We get a ZeroDivisionError with an image shape of (2, 84, 580, 576). This issue is a reminder to our future selves.

To Reproduce
Steps to reproduce the behavior:

  1. Get two 3D timepoints
  2. Make hyperstack with t=2
  3. Run denoising
  4. See error

Expected behavior
No error, smooth run.

Screenshots

Traceback (most recent call last):
  File "/Users/ahmetcan.solak/Dev/AhmetCanSolak/aydin/aydin/gui/_qt/job_runners/worker.py", line 60, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Users/ahmetcan.solak/Dev/AhmetCanSolak/aydin/aydin/gui/_qt/job_runners/denoise_job_runner.py", line 60, in start_func
    self.denoiser.train(
  File "/Users/ahmetcan.solak/Dev/AhmetCanSolak/aydin/aydin/restoration/denoise/noise2selffgr.py", line 279, in train
    self.it.train(
  File "/Users/ahmetcan.solak/Dev/AhmetCanSolak/aydin/aydin/it/base.py", line 280, in train
    self.blind_spots, autocorrelogram = auto_detect_blindspots(
  File "/Users/ahmetcan.solak/Dev/AhmetCanSolak/aydin/aydin/analysis/blind_spot_analysis.py", line 105, in auto_detect_blindspots
    image = representative_crop(image, crop_size=int(1e6), favour_odd_lengths=True)
  File "/Users/ahmetcan.solak/Dev/AhmetCanSolak/aydin/aydin/util/crop/rep_crop.py", line 235, in representative_crop
    translation = tuple(
  File "/Users/ahmetcan.solak/Dev/AhmetCanSolak/aydin/aydin/util/crop/rep_crop.py", line 236, in <genexpr>
    (randrange(0, max(1, (s - cs) // g)) * g if cs != s else 0)
ZeroDivisionError: integer division or modulo by zero

Additional context
Add any other context about the problem here.

@AhmetCanSolak AhmetCanSolak added the bug Something isn't working label Jun 28, 2022
@AhmetCanSolak AhmetCanSolak self-assigned this Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant