HuiZhang0812 / DiffusionAD

155 stars 16 forks source link

Training DAGM Dataset Error #51

Closed 02lenny closed 5 months ago

02lenny commented 5 months ago

class Class2 args1.json defaultdict(<class 'str'>, {'img_size': [256, 256], 'Batch_Size': 6, 'EPOCHS': 20, 'T': 1000, 'base_channels': 128, 'beta_schedule': 'linear', 'loss_type': 'l2', 'diffusion_lr': 0.0001, 'seg_lr': 1e-05, 'random_slice': True, 'weight_decay': 0.0, 'save_imgs': True, 'save_vids': False, 'dropout': 0, 'attention_resolutions': '32,16,8', 'num_heads': 4, 'num_head_channels': -1, 'noise_fn': 'gauss', 'channels': 3, 'mvtec_root_path': '/content/drive/MyDrive/DiffusionDA/DiffusionAD-main/datasets/mvtec', 'visa_root_path': '/content/drive/MyDrive/DiffusionDA/DiffusionAD-main/datasets/VisA_1class/1cls', 'dagm_root_path': '/content/drive/MyDrive/DiffusionDA/DiffusionAD-main/datasets/dagm', 'mpdd_root_path': '/content/drive/MyDrive/DiffusionDA/DiffusionAD-main/datasets/mpdd', 'anomaly_source_path': '/content/drive/MyDrive/DiffusionDA/DiffusionAD-main/datasets/DTD', 'noisier_t_range': 600, 'less_t_range': 300, 'condition_w': 1, 'eval_normal_t': 200, 'eval_noisier_t': 400, 'output_path': 'outputs', 'arg_num': '1'}) Traceback (most recent call last): File "/content/drive/MyDrive/DiffusionDA/DiffusionAD-main/train.py", line 333, in main() File "/content/drive/MyDrive/DiffusionDA/DiffusionAD-main/train.py", line 315, in main training_dataset_loader = DataLoader(training_dataset, batch_size=args['Batch_Size'],shuffle=True,num_workers=8,pin_memory=True,drop_last=True) File "/usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py", line 344, in init sampler = RandomSampler(dataset, generator=generator) # type: ignore[arg-type] File "/usr/local/lib/python3.10/dist-packages/torch/utils/data/sampler.py", line 107, in init raise ValueError("num_samples should be a positive integer " ValueError: num_samples should be a positive integer value, but got num_samples=0

HuiZhang0812 commented 5 months ago

This seems to be a problem with the dataloader: the image is not loaded correctly. Did you encounter this problem when training class1?