Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Training Error! #16

Open
aybukesakaci opened this issue Nov 6, 2023 · 6 comments
Open

Training Error! #16

aybukesakaci opened this issue Nov 6, 2023 · 6 comments

Comments

@aybukesakaci
Copy link

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!

@Hlings
Copy link
Owner

Hlings commented Nov 6, 2023

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.

@SumayyaInayat
Copy link

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!

@Hlings
Copy link
Owner

Hlings commented Nov 16, 2023

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

@aybukesakaci
Copy link
Author

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
Copy link
Author

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

image

@SumayyaInayat
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants