JustinTebbe / Dynamic-noise-AD

MIT License
6 stars 0 forks source link

我的檔案路徑可以用window寫法嗎 #3

Open henrychou1233 opened 2 months ago

henrychou1233 commented 2 months ago

data: DA_batch_size: 30 batch_size: 30 category: grid data_dir: /mnt/d/download2/aaa/Dynamic-noise-AD-master/MVTec/ image_size: 256 imput_channel: 4 manualseed: -1 mask: true name: MVTec metrics: image_level_AUROC: true image_level_F1Score: true pixel_level_AUROC: true pixel_level_F1Score: true pro: true threshold: manual_image: null manual_pixel: null method: adaptive model: DA_epochs: 1 # nr. of fine tune epochs for fe DA_fine_tune: 1 DA_learning_rate: 1e-4 DA_rnd_step: true # pick noising level for DA according to uniform distribution dynamic_steps: true # Dynamic implicit conditioning KNN_metric: l1 anomap_excluded_layers: # excluded feature layers for anomaly map creation

0 anomap_weighting: 0.85 # weight for latent anomaly map attn_reso: 32 16 8 4 beta_end: 0.0195 beta_start: 0.0015 channel_mults: 1 2 2 4 4 checkpoint_dir: /mnt/d/download2/aaa/Dynamic-noise-AD-master/checkpoints/MVTec/ checkpoint_epochs: 300 checkpoint_name: weights consistency_decoder: 0 # consistency decoder for better image quality at the cost of additional runtime device: cuda distance_metric_eval: combined downscale_first: 1 # noiseless scaling ema: true ema_rate: 0.999 epochs: 9 eta: 0 # 0 corresponds to DDIM sampling and 1 to DDPM eta2: 4 # DDAD conditioning exp_name: default fe_backbone: resnet34 head_channel: -1 knn_k: 20 latent: true latent_backbone: VAE latent_size: 32 learning_rate: 1e-4 multi_gpu: false n_head: 8 noise: Gaussian noise_sampling: 0 # noise image or not num_workers: 30 optimizer: AdamW save_model: true schedule: linear seed: 42 selected_features: # selected layer for KNN search 1 skip: 8 # steps to skip during inference skip_DA: 8 # steps to skip during domain adaptation test_trajectoy_steps: 80 # maximum noising level test_trajectoy_steps_DA: 80 # maximum noising level for domain adaptation trajectory_steps: 1000 unet_channel: 192 visual_all: true # additional visual output of heatmaps weight_decay: 0.01 以上是我的config包 但都一直偵測不到 (AI) PS D:\download2\aaa\Dynamic-noise-AD-master> python main.py 2024-07-15 10:15:07.106301: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0. 2024-07-15 10:15:07.624565: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0. Num params: 281088004 Current device is cuda Traceback (most recent call last): File "D:\download2\aaa\Dynamic-noise-AD-master\main.py", line 158, in execute_main_test() File "D:\download2\aaa\Dynamic-noise-AD-master\main.py", line 154, in execute_main_test train(args) File "D:\download2\aaa\Dynamic-noise-AD-master\main.py", line 74, in train trainer(unet, constants_dict, ema_helper, config) File "D:\download2\aaa\Dynamic-noise-AD-master\train.py", line 31, in trainer trainloader = torch.utils.data.DataLoader( File "C:\Users\user.conda\envs\AI\lib\site-packages\torch\utils\data\dataloader.py", line 350, in init sampler = RandomSampler(dataset, generator=generator) # type: ignore[arg-type] File "C:\Users\user.conda\envs\AI\lib\site-packages\torch\utils\data\sampler.py", line 143, in init raise ValueError(f"num_samples should be a positive integer value, but got num_samples={self.num_samples}") ValueError: num_samples should be a positive integer value, but got num_samples=0

JustinTebbe commented 1 month ago

Your data_dir in the config seems to be wrong or empty. The dataloader can't find any images