The while loop starting at line 213 of metadata_syntheziser.py has the potential to cause an infinite loop. If np.sum(gaps) > self._total_silence_time_per_layer*10. but all gap values are less than2.*mult_min_gap_len then picked_gaps = np.argwhere(gaps > 2.*mult_min_gap_len) results in len(picked_gaps) == 0 this causes no change to gaps values when gaps[picked_gaps] -= eq_subtract so the loop will carry on infinitely. Below is a minimal example to recreate the issue when using mixture_duration = 15. and event_time_per_layer =10 using source files from NIGEN dataset.
gaps = np.array([16.,10.,18.,10])
total_silence_time_per_layer = 5.0
multi_min_gap_len = 10.
while np.sum(gaps) > self._total_silence_time_per_layer * 10.:
silence_diff = np.sum(gaps) - self._total_silence_time_per_layer * 10. # silence_diff: 4.0
picked_gaps = np.argwhere(gaps > 2. * mult_min_gap_len) # what if there are no gaps of this length # picked_gaps: []
eq_subtract = silence_diff / len(picked_gaps) # eq_subtract: inf
picked_gaps = np.argwhere((gaps - eq_subtract) > mult_min_gap_len) # picked_gaps: []
gaps[picked_gaps] -= eq_subtract # gaps: [16., 10., 18., 10]
The while loop starting at line 213 of metadata_syntheziser.py has the potential to cause an infinite loop. If
np.sum(gaps) > self._total_silence_time_per_layer*10.
but all gap values are less than2.*mult_min_gap_len
thenpicked_gaps = np.argwhere(gaps > 2.*mult_min_gap_len)
results inlen(picked_gaps) == 0
this causes no change togaps
values whengaps[picked_gaps] -= eq_subtract
so the loop will carry on infinitely. Below is a minimal example to recreate the issue when usingmixture_duration = 15
. andevent_time_per_layer =10
using source files from NIGEN dataset.