RetroCirce / HTS-Audio-Transformer

The official code repo of "HTS-AT: A Hierarchical Token-Semantic Audio Transformer for Sound Classification and Detection"
https://arxiv.org/abs/2202.00874
MIT License
341 stars 62 forks source link

Hello, I have the following problem when running the code, what is the reason? #13

Closed ykingliu closed 2 years ago

ykingliu commented 2 years ago

RuntimeError: upsample_bicubic2d_backward_out_cuda does not have a deterministic implementation, but you set 'torch.use_deterministic_algorithms(True)'. You can turn off determinism just for this operation, or you can use the 'warn_only=True' option, if that's acceptable for your application. You can also file an issue at https://github.com/pytorch/pytorch/issues to help us prioritize adding deterministic support for this operation

RetroCirce commented 2 years ago

In the main.py search 'deterministic', and set it to be True (inside the trainer instance) I think this is because the latest version of PyTorch and PyTorch lightening make it underteministic.

Best, Ke

ykingliu commented 2 years ago

Thank you for your  reply. Which version of pytorch do you use?

------------------ 原始邮件 ------------------ 发件人: "RetroCirce/HTS-Audio-Transformer" @.>; 发送时间: 2022年7月27日(星期三) 上午8:33 @.>; @.**@.>; 主题: Re: [RetroCirce/HTS-Audio-Transformer] Hello, I have the following problem when running the code, what is the reason? (Issue #13)

In the main.py search 'deterministic', and set it to be True (inside the trainer instance) I think this is because the latest version of PyTorch and PyTorch lightening make it underteministic.

Best, Ke

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

RetroCirce commented 2 years ago

At that time I think it is 1.10.2. But it doesn't matter, because even you just set the deterministic to be False (sorry it should be False not True as above), the model can work as the same.

ykingliu commented 2 years ago

Yes, I also the deterministic to be False, but when training esc-50, the final accuracy of epoch=100 is only about 62%. So I wonder if it is related to this parameter ( deterministic=false)

------------------ 原始邮件 ------------------ 发件人: "RetroCirce/HTS-Audio-Transformer" @.>; 发送时间: 2022年7月27日(星期三) 上午9:20 @.>; @.**@.>; 主题: Re: [RetroCirce/HTS-Audio-Transformer] Hello, I have the following problem when running the code, what is the reason? (Issue #13)

At that time I think it is 1.10.2. But it doesn't matter, because even you just set the deterministic to be False (sorry it should be False not True as above), the model can work as the same.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

RetroCirce commented 2 years ago

When training the ESC-50 dataset, you need to use the pertained audioset model, instead of the the pretrain imagine model. This follows the previous settings from benchmark. Check this issue (while this is in Chinese): https://github.com/RetroCirce/HTS-Audio-Transformer/issues/6

Also check this, my new-writing esc-50 training tutorial It should help you out.

ykingliu commented 2 years ago

Thank you for your help. I have solved the problem and successfully reproduced your results. I wish you a happy life

------------------ 原始邮件 ------------------ 发件人: "RetroCirce/HTS-Audio-Transformer" @.>; 发送时间: 2022年7月27日(星期三) 上午9:32 @.>; @.**@.>; 主题: Re: [RetroCirce/HTS-Audio-Transformer] Hello, I have the following problem when running the code, what is the reason? (Issue #13)

When training the ESC-50 dataset, you need to use the pertained audioset model, instead of the the pretrain imagine model. This follows the previous settings from benchmark. Check this issue (while this is in Chinese):

6

Also check this, my new-writing esc-50 training tutorial It should help you out.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>