GithubHelp home page GithubHelp logo

Comments (7)

YuanGongND avatar YuanGongND commented on June 30, 2024

it seems it is due to the inconsistent input_tdim in training and inference, could you share the training script (in particular, what is the input_tdim?). Thanks!

from ast.

jmren168 avatar jmren168 commented on June 30, 2024

Thanks for the reply. Here's the training script:

set=full
imagenetpretrain=True
if [ $set == balanced ]
then
  bal=none
  lr=5e-5
  epoch=25
  #tr_data=/data/sls/scratch/yuangong/aed-pc/src/enhance_label/datafiles_local/balanced_train_data_type1_2_mean.json
  tr_data=./data/datafiles/train_data.json
  lrscheduler_start=10
  lrscheduler_step=5
  lrscheduler_decay=0.5
  wa_start=6
  wa_end=25
else
  bal=bal
  lr=1e-5
  epoch=15 #5
  tr_data=./data/datafiles/train_data.json
  lrscheduler_start=4 #2
  lrscheduler_step=1 #1
  lrscheduler_decay=0.25 #0.5
  wa_start=1
  wa_end=15 #5
fi
#te_data=/data/sls/scratch/yuangong/audioset/datafiles/eval_data.json
te_data=./data/datafiles/valid_data.json
freqm=48
timem=62 # 192
mixup=0
# corresponding to overlap of 6 for 16*16 patches
fstride=10
tstride=10
batch_size=4 # 12

dataset_mean=-4.2677393
dataset_std=4.5689974
audio_length=512 #1024
noise=False

from ast.

YuanGongND avatar YuanGongND commented on June 30, 2024

If you set audio_length=512 in training, then in inference, shouldn't the input_tdim=312 be 512?

from ast.

jmren168 avatar jmren168 commented on June 30, 2024

It works, and thanks again.

BTW, when I loaded fine-tuned weights to update audioset pretrained model, do I set audioset_pretrain=True or audioset_pretrain=False?

model = ASTModel(label_dim=class_num, fstride=10, tstride=10, input_fdim=128, input_tdim=input_tdim, **audioset_pretrain=True**, model_size='base384',verbose=False)

from ast.

YuanGongND avatar YuanGongND commented on June 30, 2024

I guess it doesn't matter.

You can check by

model.load_state_dict(sd, strict=True), so it ensures the new weight fully covers all parameters (so which initial model does not matter).

-Yuan

from ast.

jmren168 avatar jmren168 commented on June 30, 2024

Just setting strict=True forces new weights are loaded. Thanks for the reply.

from ast.

YuanGongND avatar YuanGongND commented on June 30, 2024

thanks for letting me know.

  • Just to clarify, strict=True itself does not change the loading behavior, but it will throw an error if the model parameter and the checkpoint are mismatched. If you don't see an error, that means all parameters are loaded from the checkpoint.

-Yuan

from ast.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.