Installation
Last updated
Last updated
Before you start, youβll need to setup your environment and install the appropriate packages. π Datasets is tested on Python 3.7+.
If you want to use π Datasets with TensorFlow or PyTorch, youβll need to install them separately. Refer to the or the for the specific install command for your framework.
You should install π Datasets in a to keep things tidy and avoid dependency conflicts.
Create and navigate to your project directory:
Copied
Start a virtual environment inside your directory:
Copied
Activate and deactivate the virtual environment with the following commands:
Copied
Once youβve created your virtual environment, you can install π Datasets in it.
The most straightforward way to install π Datasets is with pip:
Copied
Run the following command to check if π Datasets has been properly installed:
Copied
Copied
Copied
Copied
Copied
Building π Datasets from source lets you make changes to the code base. To install from the source, clone the repository and install with the following commands:
Copied
Again, you can check if π Datasets was properly installed with the following command:
Copied
π Datasets can also be installed from conda, a package management system:
Copied
This command downloads version 1 of the , loads the training split, and prints the first training example. You should see:
To work with audio datasets, you need to install the feature as an extra dependency:
To decode mp3 files, you need to have at least version 1.1.0 of the libsndfile
system library. Usually, itβs bundled with the python package, which is installed as an extra audio dependency for π Datasets. For Linux, the required version of libsndfile
is bundled with soundfile
starting from version 0.12.0. You can run the following command to determine which version of libsndfile
is being used by soundfile
:
To work with image datasets, you need to install the feature as an extra dependency: