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

Ratios with a non-two factor cause instant m4l crash #69

Open
leoauri opened this issue Feb 19, 2024 · 0 comments · May be fixed by #73
Open

Ratios with a non-two factor cause instant m4l crash #69

leoauri opened this issue Feb 19, 2024 · 0 comments · May be fixed by #73

Comments

@leoauri
Copy link

leoauri commented Feb 19, 2024

Hi there,

An in_ratio which has some non-two factor seems to cause max for live to instantly crash upon running inference.

For example

class EmptyRatio(nn_tilde.Module):
    def __init__(self, in_channels=1, in_ratio=1, out_channels=1, out_ratio=1):
        super().__init__()

        self.out_channels = out_channels
        self.out_ratio = out_ratio
        self.in_ratio = in_ratio

        self.register_method(
            "forward",
            in_channels=in_channels, 
            in_ratio=in_ratio, 
            out_channels=out_channels, 
            out_ratio=out_ratio,
            test_buffer_size=int(8192/out_ratio*in_ratio)
        )

    @torch.jit.export
    def forward(self, x):
        b, _, l = x.shape
        return torch.zeros(b, self.out_channels, int(l / self.out_ratio * self.in_ratio))

these work

EmptyRatio().export_to_ts('emptyratio.ts')
...
nn~ emptyratio
EmptyRatio(in_ratio=8).export_to_ts('emptyratio8.ts')
...
nn~ emptyratio8

But this crashes instantly:

EmptyRatio(in_ratio=5).export_to_ts('emptyratio5.ts')
...
nn~ emptyratio5

Is that crash unexpected? Is there a technical reason why it cannot work?

Example use case: run encodec decoder (input ratio of 320).

Many thanks,

@leoauri leoauri linked a pull request Mar 18, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant