Closed henrychou1233 closed 7 months ago
Currently we don't provide the weights, therefore you have to train a model on your own before you can run the evaluation.
As a guidance for the checkpoint epochs here are our settings for the best VisA results:
VisA_dict = {"candle": {"eta2": 8, "DA_epochs": 0, "DA_fine_tune": 1, "checkpoint_epochs": 50},
"capsules": {"eta2": 7, "DA_epochs": 0, "DA_fine_tune": 1, "checkpoint_epochs": 200},
"cashew": {"eta2": 8, "DA_epochs": 3, "DA_fine_tune": 1, "checkpoint_epochs": 100},
"chewinggum": {"eta2": 10, "DA_epochs": 2, "DA_fine_tune": 1, "checkpoint_epochs": 150},
"fryum": {"eta2": 7, "DA_epochs": 2, "DA_fine_tune": 1, "checkpoint_epochs": 200},
"macaroni1": {"eta2": 10, "DA_epochs": 0, "DA_fine_tune": 1, "checkpoint_epochs": 300},
"macaroni2": {"eta2": 9, "DA_epochs": 3, "DA_fine_tune": 1, "checkpoint_epochs": 150},
"pcb1": {"eta2": 10, "DA_epochs": 1, "DA_fine_tune": 1, "checkpoint_epochs": 250},
"pcb2": {"eta2": 10, "DA_epochs": 0, "DA_fine_tune": 1, "checkpoint_epochs": 300},
"pcb3": {"eta2": 10, "DA_epochs": 0, "DA_fine_tune": 1, "checkpoint_epochs": 250},
"pcb4": {"eta2": 7, "DA_epochs": 0, "DA_fine_tune": 1, "checkpoint_epochs": 200},
"pipe_fryum": {"eta2": 9, "DA_epochs": 1, "DA_fine_tune": 1, "checkpoint_epochs": 300}}
data: DA_batch_size: 8 batch_size: 8 category: pcb1 data_dir: /home/anywhere3090l/Desktop/henry/D3AD-master/VisA image_size: 256 imput_channel: 4 manualseed: -1 mask: true name: VisA 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
我可以直接把checkponts路徑刪掉嗎 FileNotFoundError: [Errno 2] No such file or directory: 'results/pcb1/pcb1sample0_8_save_all_clear_T_hat20.0_T_max80.png' 有出現error 該怎麼辦 謝謝您
On Tue, Jan 30, 2024 at 5:49 PM JustinTebbe @.***> wrote:
Currently we don't provide the weights, therefore you have to train a model on your own before you can run the evaluation.
As a guidance for the checkpoint epochs here are our settings for the best VisA results:
VisA_dict = {"candle": {"eta2": 8, "DA_epochs": 0, "DA_fine_tune": 1, "checkpoint_epochs": 50}, "capsules": {"eta2": 7, "DA_epochs": 0, "DA_fine_tune": 1, "checkpoint_epochs": 200}, "cashew": {"eta2": 8, "DA_epochs": 3, "DA_fine_tune": 1, "checkpoint_epochs": 100}, "chewinggum": {"eta2": 10, "DA_epochs": 2, "DA_fine_tune": 1, "checkpoint_epochs": 150}, "fryum": {"eta2": 7, "DA_epochs": 2, "DA_fine_tune": 1, "checkpoint_epochs": 200}, "macaroni1": {"eta2": 10, "DA_epochs": 0, "DA_fine_tune": 1, "checkpoint_epochs": 300}, "macaroni2": {"eta2": 9, "DA_epochs": 3, "DA_fine_tune": 1, "checkpoint_epochs": 150}, "pcb1": {"eta2": 10, "DA_epochs": 1, "DA_fine_tune": 1, "checkpoint_epochs": 250}, "pcb2": {"eta2": 10, "DA_epochs": 0, "DA_fine_tune": 1, "checkpoint_epochs": 300}, "pcb3": {"eta2": 10, "DA_epochs": 0, "DA_fine_tune": 1, "checkpoint_epochs": 250}, "pcb4": {"eta2": 7, "DA_epochs": 0, "DA_fine_tune": 1, "checkpoint_epochs": 200}, "pipe_fryum": {"eta2": 9, "DA_epochs": 1, "DA_fine_tune": 1, "checkpoint_epochs": 300}}
— Reply to this email directly, view it on GitHub https://github.com/JustinTebbe/D3AD/issues/1#issuecomment-1916455906, or unsubscribe https://github.com/notifications/unsubscribe-auth/BA6U57Q6D5UFFHUKPZWFDVDYRC6Y3AVCNFSM6AAAAABCQWMHYKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJWGQ2TKOJQGY . You are receiving this because you authored the thread.Message ID: @.***>
I suspect that the folder structure is not properly set up and that the subfolder 'pcb1' is missing. You need to set it up manually like this:
results
|--- pcb1
|--- pcb2
|--- ...
(base) @.***:~/Desktop/henry/D3AD-master$ python main.py Num params: 281088004 Current device is cuda Epoch 0 | Loss: 0.9991011619567871 training time on 1 epochs is 0:00:55.449689
Traceback (most recent call last):
File "/home/anywhere3090l/Desktop/henry/D3AD-master/main.py", line 158,
in
On Tue, Jan 30, 2024 at 6:36 PM JustinTebbe @.***> wrote:
I suspect that the folder structure is not properly set up and that the subfolder 'pcb1' is missing. You need to set it up manually like this:
results |--- pcb1 |--- pcb2 |--- ...
— Reply to this email directly, view it on GitHub https://github.com/JustinTebbe/D3AD/issues/1#issuecomment-1916551221, or unsubscribe https://github.com/notifications/unsubscribe-auth/BA6U57UOKHHCNJZPOVPH6MDYRDEJ5AVCNFSM6AAAAABCQWMHYKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJWGU2TCMRSGE . You are receiving this because you authored the thread.Message ID: @.***>
Might be related to dataparallel, you could try to uncomment lines 98-104 in main.py and comment out line 105. So it should look like:
else:
#use commented out code when trained on multigpu but inference on single gpu
new_state_dict = OrderedDict()
for k, v in checkpoint.items():
name = k[7:] # remove `module.` prefix added by DataParallel
new_state_dict[name] = v
unet.load_state_dict(new_state_dict)
#unet.load_state_dict(checkpoint)
l:~/Desktop/henry/D3AD-ma (base) @.***:~/Desktop/henry/D3AD-master$ python main.py File "/home/anywhere3090l/Desktop/henry/D3AD-master/main.py", line 100 for k, v in checkpoint.items(): ^ IndentationError: unindent does not match any outer indentation level
On Tue, Jan 30, 2024 at 8:13 PM JustinTebbe @.***> wrote:
Might be related to dataparallel, you could try to uncomment lines 98-104 in main.py and comment out line 105. So it should look like:
else: #use commented out code when trained on multigpu but inference on single gpu
new_state_dict = OrderedDict()
for k, v in checkpoint.items(): name = k[7:] # remove `module.` prefix added by DataParallel new_state_dict[name] = v unet.load_state_dict(new_state_dict) #unet.load_state_dict(checkpoint)
— Reply to this email directly, view it on GitHub https://github.com/JustinTebbe/D3AD/issues/1#issuecomment-1916711653, or unsubscribe https://github.com/notifications/unsubscribe-auth/BA6U57SBLHPKBZ7HFU6573DYRDPWTAVCNFSM6AAAAABCQWMHYKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJWG4YTCNRVGM . You are receiving this because you authored the thread.Message ID: @.***>
Sounds like and indentation level error, likely introduced through copying or uncommenting. Please make sure that the indentation level is correct and refer to the original main.py file for the correct indentation
FileNotFoundError: [Errno 2] No such file or directory: '/home/anywhere3090l/Desktop/henry/D3AD-master/checkpoints/VisA/pcb1/32_1928-1_diffusers_unet_300'