wsntxxn / AudioCaption

Audio captioning recipe
MIT License
40 stars 4 forks source link

Dcase2021 #7

Closed qipotianMFXT closed 3 months ago

qipotianMFXT commented 1 year ago

Excuse me, in the branch of dcase2021, it seems that there are some missing hyperparameters in both the dcase2021_xe.yaml and dcase2021_scst.yaml configuration files. Could you please provide the complete configuration files?

wsntxxn commented 1 year ago

Which hyperparameters are missing?

qipotianMFXT commented 1 year ago

Thank you for your reply! For example,there are some codes in class Runner in run.py

def _get_model(config, outputfun=sys.stdout): vocabulary = config["vocabulary"] encoder = getattr( encoder1, config["encoder"])( config["data"]["raw_feat_dim"], config["data"]["fc_feat_dim"], config["data"]["attn_feat_dim"], **config["encoder_args"] ) Therefore,not only the structure of config in your dcase2021 should change,but also some hyperparameters need to be added.

data:      total_iters:      zh: False      raw_feat_dim:      fc_feat_dim:      attn_feat_dim:

wsntxxn commented 1 year ago

The DCASE2021 branch uses captioning/ignite_runners/run.py instead of captioning/pytorch_runners/run.py

qipotianMFXT commented 1 year ago

Although in https://github.com/wsntxxn/AudioCaption/blob/dcase2021/captioning/ignite_runners/run.py, these hyperparameters also lack. class Runner(BaseRunner): @staticmethod def _get_model(config, outputfun=sys.stdout): vocabulary = config["vocabulary"] encoder = getattr( captioning.models.encoder, config["encoder"])( config["data"]["raw_feat_dim"], config["data"]["fc_feat_dim"], config["data"]["attn_feat_dim"], **config["encoder_args"] ) These hyperparameters also need to be added. data:     total_iters:     zh: False     raw_feat_dim:     fc_feat_dim:     attn_feat_dim:

wsntxxn commented 1 year ago

These are automatically generated during training: https://github.com/wsntxxn/AudioCaption/blob/dcase2021/captioning/ignite_runners/run.py#L122, https://github.com/wsntxxn/AudioCaption/blob/dcase2021/captioning/ignite_runners/run.py#L297.

qipotianMFXT commented 1 year ago

These are automatically generated during training: https://github.com/wsntxxn/AudioCaption/blob/dcase2021/captioning/ignite_runners/run.py#L122, https://github.com/wsntxxn/AudioCaption/blob/dcase2021/captioning/ignite_runners/run.py#L297.

I'm so sorry to bother you another time. In the code of dcase2021, performing "prepare data" operations does not affect the config, and when executing the training script, it is necessary to use the fire to execute the Runner class first. The static method _get_model in the Runner class needs to be based on the raw_feat_dim, fc_feat_dim, and attn_feat_dim under the data configuration file. When I tried to reproduce your code for Dcase 2021, I found that when executing "python ignite_runners\run.py train config\dcase2021\dcase2021_xe.yaml", it indeed reported a KeyError: 'data' error. So, could you please check it again?

wsntxxn commented 1 year ago

Configuration updated and you can try again.