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
Inference ESC-50 fine-tuned model #12
Comments
Hi thanks! # Loading the weights
p ="output/esc50/_None/checkpoints/epoch=4-step=2669.ckpt"
ckpt = torch.load(p)
net_statedict = {k[4:]: v.cpu() for k, v in ckpt['state_dict'].items() if k.startswith("net.")} # main weights
net_swa = {k[len("net_swa."):]: v.cpu() for k, v in ckpt['state_dict'].items() if k.startswith("net_swa.")} # swa weights
# getting the model
from hear21passt.base import load_model, get_scene_embeddings, get_timestamp_embeddings
model = load_model(mode="logits").cuda()
model.net.load_state_dict(net_statedict) # loading the fine-tuned weights
# example
wave_example = torch.ones((3, 32000 * 5))*0.5
logits = model(wave_example) |
Thank you so much for the reply.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, authors.
Thank you for sharing the great work.
I tried to fine-tuned AudioSet pretrained model
passt-s-f128-p16-s10-ap.476-swa.pt
on ESC-50 dataset by usingex_esc50.py
.I got checkpoints saved in
output/esc50/_None/checkpoints/epoch=4-step=2669.ckpt
.I want to load the checkpoint and inference with audio file. I am trying to load the checkpoint model and tried to used passt_hear21 for inference but kinda lost track of the process.
Could you please share how to inference with the saved checkpoints on audio file?
The text was updated successfully, but these errors were encountered: