ACT icon indicating copy to clipboard operation
ACT copied to clipboard

Add support for TorchVision-external datasets

Open hanyuone opened this issue 5 months ago • 0 comments

I am working with a dataset that is not in torchvision.datasets. However, neither TorchVisionSpecCreator nor VNNLibSpecCreator support these types of datasets out-of-the-box.

This is because in the default function TorchVisionSpecCreator.create_specs_for_data_model_pairs, the download_dataset_model_pair function in act/front_end/torchvision_loader/data_model_loader.py is called, which fetches directly from torchvision.datasets, and errors if that dataset doesn't exist:

        if not dataset_exists:
            print(f"\n[1/3] Downloading dataset...")
            
            import torchvision.datasets
            dataset_class = getattr(torchvision.datasets, dataset_name, None)
            
            if dataset_class is None:
                return {
                    'status': 'error',
                    'message': f"Dataset {dataset_name} not found in torchvision.datasets"
                }

hanyuone avatar Jun 07 '26 23:06 hanyuone