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

Errors when using generate label #8

Open
sunwell1994 opened this issue Oct 4, 2021 · 3 comments
Open

Errors when using generate label #8

sunwell1994 opened this issue Oct 4, 2021 · 3 comments

Comments

@sunwell1994
Copy link

Dear author, I have several questions on generating labels

  1. in ./mobile_crnn/generat_label.py,
  • should there be the ident for the for loop?
  • should we use the Spec.h5 instead of Audio.h5
  • why is the aggregation process different generate_labelv.py?
  1. for generate_labelv.py
  • which resnet to use, the one in ./resnet or pretrained resnet from torch
  • why set top k to be 0?

Thanks for your answer. It is not trivial to run the files directly. It will be best if the labels are provided. Thanks.

@zjsong
Copy link

zjsong commented Oct 15, 2021

Hi @shvdiwnkozbw , thanks for sharing the code.

In the following command, do we need to insert keyword largest=False into torch.topk? Because the default setting is largest=True...

prob[torch.topk(prob, dim=1, k=990)] = 0

@shvdiwnkozbw
Copy link
Owner

Dear author, I have several questions on generating labels

  1. in ./mobile_crnn/generat_label.py,
  • should there be the ident for the for loop?
  • should we use the Spec.h5 instead of Audio.h5
  • why is the aggregation process different generate_labelv.py?
  1. for generate_labelv.py
  • which resnet to use, the one in ./resnet or pretrained resnet from torch
  • why set top k to be 0?

Thanks for your answer. It is not trivial to run the files directly. It will be best if the labels are provided. Thanks.

Thanks for pointing out, I made some mistakes when reimplementing this code for label generation.
Yes, there should be indent, and use spec.h5 for label generation.
When generate label_v, we use imagenet-pretrained resnet-50 in torchvision for label prediction. In order to align the audio and visual categories, we need to aggregate the category predictions from 1000 imagenet categories into 7 general classes in audioset.

@shvdiwnkozbw
Copy link
Owner

Hi @shvdiwnkozbw , thanks for sharing the code.

In the following command, do we need to insert keyword largest=False into torch.topk? Because the default setting is largest=True...

prob[torch.topk(prob, dim=1, k=990)] = 0

Yes, it is mistake in reimplementing this script, it should be largest=False. Thanks!

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