AudioDataset() takes no arguments
- User
AudioDataset() takes no arguments
- Assistant
- User
write a script that takes lq and hq spectrograms in .npy and proseses them to be redy for training a model that upscales audio in python that works in colab
- Assistant
- User
the hq and lq spectograms are in 2 folders called lq and hq and they have the same name but they have lq and hq in the name (exsample:doitlq and doithq)
- Assistant
- User
- Assistant
- User
that script gave this error --------------------------------------------------------------------------- ValueError Traceback (most recent call last) in <cell line: 46>() 44 45 # Load the dataset ---> 46 lq_spectrograms, hq_spectrograms = load_dataset(lq_dir, hq_dir) 47 48 # Split and prepare the data as in the previous script
in load_dataset(lq_dir, hq_dir) 37 print(f'Missing HQ file for {lq_file}') 38 ---> 39 return np.array(lq_specs), np.array(hq_specs) 40 41 # Update the paths to your folders
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 3 dimensions. The detected shape was (4, 2, 128) + inhomogeneous part.
- Assistant
- User
add that to this import os import numpy as np import torch from torch.utils.data import Dataset, DataLoader from sklearn.model_selection import train_test_split import re
Define dataset class
class SpectrogramDataset(Dataset): def init(self, low_quality_spectrograms, high_quality_spectrograms): self.low_quality_spectrograms = low_quality_spectrograms self.high_quality_spectrograms = high_quality_spectrograms
- Assistant
- User
it gives me this but the file dose exsist --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) in <cell line: 53>() 51 52 # Load the dataset ---> 53 lq_spectrograms, hq_spectrograms = load_dataset(lq_dir, hq_dir) 54 55 # Split and prepare the data as in the previous script
in load_dataset(lq_dir, hq_dir) 21 # Function to load the dataset 22 def load_dataset(lq_dir,hq_dir): ---> 23 lq_files = os.listdir(lq_dir) 24 lq_specs, hq_specs = [], [] 25
FileNotFoundError: [Errno 2] No such file or directory: '/content/dataset/processed/LQPRO'
- Assistant
The
FileNotFoundErroryou're encountering suggests that Python can't locate the directory you've specified for your low-quality (LQ) spectrograms, . Here are a few common reasons and solutions for this issue: