audeering / auglib

Data augmentation for audio
https://audeering.github.io/auglib/
Other
10 stars 0 forks source link

Conversion to string can be stuck when using random variables #26

Open hagenw opened 4 months ago

hagenw commented 4 months ago

When defining

import audb
import auglib

db = audb.load("musan", only_metadata=True, tables="speech")
olist = auglib.observe.List(list(db.files), draw=True)
transform = auglib.transform.BabbleNoise(list(db.files))

If we now execute the following two statements, they return immediatly:

print(olist)
print(transform)

But when using the observe object as part of the transform definition, the print statement uses 100% CPU and never returns:

transform = auglib.transform.BabbleNoise(auglib.observe.List(list(db.files), draw=True))
print(transform)
hagenw commented 4 months ago

This error does not happen for the last non open-source version 0.12.2 of auglib.

hagenw commented 4 months ago

The error seems to happen only for the auglib.transform.BabbleNoise transform, not when using auglib.transform.Mix.

hagenw commented 4 months ago

The problem is that we are not supposed to provide the speech list as an observe argument here, as it is internally transformed to an observe object anyway:

transform = auglib.transform.BabbleNoise(list(db.files))

We also state in the docstring that only a sequence and not an observe object is expected as input:

image

But as the code is simply stuck forever when providing an observe object, we might think raising an error in this case to avoid this.