Skip to content

Segmentation fault (core dumped) #98

Open
@JinYuanZhang999

Description

@JinYuanZhang999

I was able to run the programmatic code normally before, but now it throws an error. Below are my running code and the error message:

code:

import dac
from audiotools import AudioSignal
import time
import torch

model_path = dac.utils.download(model_type="24khz")

start_time1=time.time()

model = dac.DAC.load(model_path)

model.to('cuda')

signal = AudioSignal('Encodec_sample.wav')

start_time = time.time()

signal.to(model.device)

x = model.preprocess(signal.audio_data, signal.sample_rate)
z, codes, latents, _, _ = model.encode(x)

end_time = time.time()
print(f"编码过程耗时: {end_time - start_time} 秒")

start_time = time.time()

y = model.decode(z)

end_time = time.time()
print(f"解码过程耗时: {end_time - start_time} 秒")

output_signal = AudioSignal(y.detach().cpu(), sample_rate=signal.sample_rate)

output_signal.write('output.wav')

The error message is as follows in the image:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions