I am trying to use the demucs package in python and i have already installed the demucs package as well but suddenly i am getting this issue.
this below is my code which i am trying to use.
`
import os
from tqdm import tqdm
import torch
from demucs import pretrained
from demucs.apply import apply_model
import torchaudio
def separate_vocals(input_folder, output_folder):
if not os.path.exists(output_folder):
os.makedirs(output_folder)
wav_files = [f for f in os.listdir(input_folder) if f.endswith('.wav')]
model = pretrained.get_model('htdemucs')
model.to('cuda' if torch.cuda.is_available() else 'cpu')
for wav_file in tqdm(wav_files, desc="Processing files"):
input_path = os.path.join(input_folder, wav_file)
wav, sr = torchaudio.load(input_path)
wav = wav.to('cuda' if torch.cuda.is_available() else 'cpu')
sources = apply_model(model, wav, shifts=1, split=True, overlap=0.25)
vocals = sources[0]
output_path = os.path.join(output_folder, wav_file)
torchaudio.save(output_path, vocals.cpu(), sr)
`
I am getting the below error on my screen.
Traceback (most recent call last): File "/workspace/all_process.py", line 4, in <module> from demucs import pretrained File "/usr/local/lib/python3.10/dist-packages/demucs/pretrained.py", line 13, in <module> from dora.log import fatal, bold File "/usr/local/lib/python3.10/dist-packages/dora/__init__.py", line 66, in <module> from .explore import Explorer, Launcher File "/usr/local/lib/python3.10/dist-packages/dora/explore.py", line 27, in <module> from .shep import Shepherd, Sheep File "/usr/local/lib/python3.10/dist-packages/dora/shep.py", line 23, in <module> from . import git_save File "/usr/local/lib/python3.10/dist-packages/dora/git_save.py", line 16, in <module> from .main import DecoratedMain File "/usr/local/lib/python3.10/dist-packages/dora/main.py", line 25, in <module> from .names import NamesMixin File "/usr/local/lib/python3.10/dist-packages/dora/names.py", line 11, in <module> from .xp import XP File "/usr/local/lib/python3.10/dist-packages/dora/xp.py", line 15, in <module> from .link import Link File "/usr/local/lib/python3.10/dist-packages/dora/link.py", line 13, in <module> from . import utils File "/usr/local/lib/python3.10/dist-packages/dora/utils.py", line 18, in <module> from omegaconf.basecontainer import BaseContainer ModuleNotFoundError: No module named 'omegaconf.basecontainer'
I was expecting the model to take audios from a folder perform vocal separation on a audio file, and save that vocals file to a new folder.
I also tried installing the omegaconf module as
pip install omegaconf
still receiving the same error.
Anurag Kanade is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.