AcroFOD icon indicating copy to clipboard operation
AcroFOD copied to clipboard

Training Error!

Open aybukesakaci opened this issue 2 years ago • 6 comments

Hello,

When I run the code for the training, I get an error. The error:

image

Can you share the versions of the python, torch etc. that you used?

Thank you in advance!

aybukesakaci avatar Nov 06 '23 19:11 aybukesakaci

Hi I ran the experiments on Python 3.7 or 3.8 and pytorch 1.7. If the env can run the YOLO v5, then it can also run this repo. And, btw, I haven't met such bug :( This part is the same as YOLO v5 official repo.

gaoypeng avatar Nov 06 '23 23:11 gaoypeng

Hi, You can fix the above bug by changing the line number 288 in loss.py indices.append((b, a, gj.clamp_(0, gain[3].long() - 1), gi.clamp_(0, gain[2].long() - 1))) just add .long() to gain[3] anf gain[2] to match the data types.

I hope it helps!

SumayyaInayat avatar Nov 16 '23 10:11 SumayyaInayat

Thank you for your effort and valuable advice! I have fixed this bug.

gaoypeng avatar Nov 16 '23 21:11 gaoypeng

Hello again,

Thank you both. It works now. I have two more questions. Why are multiple ap values calculated even though I only have one class for two domains? As you can see in the fig. Which one should I take as the correct value?

image

aybukesakaci avatar Nov 25 '23 15:11 aybukesakaci

And also can you explain the variables in the pic.? Why are you using these variables?

image

aybukesakaci avatar Nov 25 '23 15:11 aybukesakaci

Hi, Good that it worked!

As for the multiple AP values values in the list, I think they are per sample (image in validation set) ap values. But for overall you would be getting map@50 and map@50 - 95, consider the one as per your requirement.

The above variables basically indicate the total batch size, for example 12 , then how much proportion must be taken from real source dataloader (bs_source) i.e 11, the rest must be taken from target dataloader (bs_target), i.e 1 as per the proportions taken by author.

Among the source samples what proportion should be taken for the target-similar samples (bs_topk) i.e 8. Only bs_topk are taken closest distance wise, rest are not considered, to compensate for the discarded amount of samples, bs_add amount, i.e 3, are added back to the batch, concat bs_add the with closest distance again...

At the end a batch is contains [(8 target-similar source samples), (1 real target samples), (3 top most target-similar source samples )].

This is what I understood from the code, If you want any other details or if I was not able to make it clear enough, please refer to code lines 276-355 in train_MMD.py.

Hope it Hepls!

SumayyaInayat avatar Nov 27 '23 08:11 SumayyaInayat