Skip to content
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

Function benchmark_from_datasets has error with parameters and kwargs #1628

Open
sudaksh14 opened this issue Mar 20, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@sudaksh14
Copy link

in the source code for the function as shown below:

def benchmark_from_datasets(**dataset_streams: Sequence[TCLDataset]) -> CLScenario:
    """Creates a benchmark given a list of datasets for each stream.

    Each dataset will be considered as a separate experience.
    Contents of the datasets must already be set, including task labels.
    Transformations will be applied if defined.

    Avalanche benchmarks usually provide at least a train and test stream,
    but this generator is fully generic.

    To use this generator, you must convert your data into an Avalanche Dataset.

    :param dataset_streams: A dictionary with stream-name as key and
        list-of-datasets as values, where stream-name is the name of the stream,
        while list-of-datasets is a list of Avalanche datasets, where
        list-of-datasets[i] contains the data for experience i.
    """
    exps_streams = []
    for stream_name, data_s in dataset_streams.items():
        for dd in data_s:
            if not isinstance(dd, AvalancheDataset):
                raise ValueError("datasets must be AvalancheDatasets")
        des = [
            DatasetExperience(dataset=dd, current_experience=eid)
            for eid, dd in enumerate(data_s)
        ]
        s = EagerCLStream(stream_name, des)
        exps_streams.append(s)
    return CLScenario(exps_streams)

the parameter dataset_streams is given as a kwarg and it gives error as it doesn't accept the dict rpovided by the user instead uses this dataset_streams as the inbuilt dict, thus always raise the Value error as the variable dd in above code is always a string. I removed the ** and now it works fine for me.

@sudaksh14 sudaksh14 added the bug Something isn't working label Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
1 participant