Open deamonyi opened 1 year ago
normal_loss = infer(test_loader,len(test_loader),skip_attention_ganomaly,criterion,normal_loss, 'normal',device,args) SHOW_MAX_NUM-->len(test_loader)
normal_loss = infer(test_loader,len(test_loader),skip_attention_ganomaly,criterion,normal_loss, 'normal',device,args) SHOW_MAX_NUM-->len(test_loader)
Thank you for helping me solve this problem.
I also found that the directory for custom data was a bit of a problem. After testing, the directories available are as follows
thank for correction !
I also found that the directory for custom data was a bit of a problem. After testing, the directories available are as follows
I also found that the directory for custom data was a bit of a problem. After testing, the directories available are as follows
The train directory has no errors and I can use
I also found that the directory for custom data was a bit of a problem. After testing, the directories available are as follows
The train directory has no errors and I can use You're right, but when you run test.py, using the original test directory will prompt you with no classes.
You're right
You're right
Should self.batchsize be test_batchsize in this place?
@deamonyi @cuteboyqq
l trace to load_data.py , it seems both train batchsize and test batchsize using the same args.batch_size.
l trace to load_data.py , it seems both train batchsize and test batchsize using the same args.batch_size.
Yes, you used the same args.batch_size, should it be args.test_batchsize when test.
I think both is OK, maybe I was too lazy to use different batch size when l write the code. You can try to modify the code and use different batch size.
normal_loss = infer(test_loader,len(test_loader),skip_attention_ganomaly,criterion,normal_loss,normal_loss = inerate(test_loader,len(test_loader),skip_attention_ganomaly,criterion,normal_loss, 'normal',device,args) SHOW_MAX_NUM-->len(test_loader)'normal',device,args)SHOW_MAX_NUM--〉len(test_loader)
Can you explain it please? What does this loss represent? Also, why do I need to input both normal and abnormal samples during testing? How can I determine whether the image I input is normal or abnormal? thankyou
Answer: normal_loss = infer(test_loader,len(test_loader),skip_attention_ganomaly,criterion,normal_loss,normal_loss = inerate(test_loader,len(test_loader),skip_attention_ganomaly,criterion,normal_loss, 'normal',device,args) SHOW_MAX_NUM-->len(test_loader)'normal',device,args)SHOW_MAX_NUM--〉len(test_loader) ~ ~ Can you explain it please? What does this loss represent? Also, why do I need to input both normal and abnormal samples during testing? How can I determine whether the image I input is normal or abnormal? thankyou
Q1 : Can you explain it please? A1: it means inference the normal dataset
Q2:What does this loss represent? A2: normal dataset loss value is lower than anomaly dataset relatively. For example : if normal dataset are male images , you only train male images , the GANomaly model only recognize the male images, so when you inference male images, the loss value should be low. But if you infernece female image, the GANomaly model do not see this type of images before, so the loss value of female images is much higher than male images That is , for example male image 1 loss : 0.51 male image 2 loss : 0.78 male image 3 loss : 0.42 ... female image 1 loss : 1.23 female image 2 loss : 2.56 female image 3 loss : 4.52 ... So you can give a loss threshold to determine the final image is male or female(anomaly)
Q3: Also, why do I need to input both normal and abnormal samples during testing? A3: you can regard the non-normal images as anomaly(abnormal) samples , because you need to see if the model ables to distinguish the normal and abnormal by loss value.
I am a beginner in GAN. After training with the skip-attention-ganomaly model in my own data set, the following problems occurred in my testing. $python test.py --normal-dir D:/DEMO/DATA/IDS/train --abnormal-dir D:/DEMO/DATA/IDS/test --view-img --img-size 32
...
I don't know if this is normal, and I don't know how I can tell if the test set is abnormal.