-
Notifications
You must be signed in to change notification settings - Fork 3
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
Issue with initializing KantoData #41
Comments
Hi Advay, Could you please provide a reproducible example, including traceback? In the meantime, the docs might help: setting up a project |
@advaymishra2003 wrote: Hi @nilomr , Thank you for getting back to me so quickly! Here's a reproducible example of the issue I encountered, along with the traceback. import pykanto Step 1: Define paths for data and outputdata_dir = "wav_files" # Directory containing audio (.wav) and JSON files Step 2: Initialize Parametersparams = Parameters( Step 3: Initialize the KantoData objectdataset = KantoData(DIRS=params, parameters=params) # Using params for DIRS Traceback Since I couldn't import ProjDirs (as it wasn’t accessible), I tried a workaround by defining a custom CustomDirs class with the required attributes (DATASET_ID, DATA_DIR, OUTPUT_DIR) and passing it as the DIRS argument. Unfortunately, this also resulted in the same error. Let me know if you need any additional details or files to reproduce the issue. Thanks again for your support! |
Hi, Please refer to the docs at https://nilomr.github.io/pykanto for examples of projects created using pykanto. Here's one showing you how to segment vocalisations into units. You can download these examples as Jupyter notebooks as well: You can use your IDE or the pykanto docs to consult the documentation for each function. E.g., to see valid arguments and variable types that you can pass to the Lastly, am not sure what you mean by this: "I couldn't import ProjDirs (as it wasn’t accessible)". Tests for pykanto are running OK; Hope that helps! |
Continues from #40
@advaymishra2003 wrote:
... However, I am running into some other problems. I am setting up pykanto to process audio data but ran into an issue with initializing KantoData. Here’s the problem and what I tried:
Issue
When trying to initialize KantoData, I got this error:
AttributeError: 'Parameters' object has no attribute 'DATASET_ID'
It seems that KantoData expects DATASET_ID within the DIRS parameter. However, ProjDirs wasn’t accessible in the import, so I couldn’t set up DIRS properly. I attempted to workoaround this problem and I created a custom CustomDirs class to manually define the directory structure and provide DATASET_ID:
class CustomDirs:
def init(self, data_dir, output_dir):
self.DATA_DIR = data_dir
self.OUTPUT_DIR = output_dir
self.DATASET_ID = "your_dataset_id"
Then I used it as follows:
custom_dirs = CustomDirs(data_dir, output_dir)
dataset = KantoData(DIRS=custom_dirs, parameters=params)
Unfortunately, this workaround didn’t resolve the issue and led to the same error.
Question
Is there an updated way to set up DIRS with the current version of pykanto, or is there a recommended approach for defining the necessary attributes for KantoData initialization?
Thanks for your help!
Best,
Advay Mishra
The text was updated successfully, but these errors were encountered: