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

'TranslationTask' object has no attribute 'args' #5488

Open
whiteSteelRain opened this issue Apr 21, 2024 · 0 comments
Open

'TranslationTask' object has no attribute 'args' #5488

whiteSteelRain opened this issue Apr 21, 2024 · 0 comments

Comments

@whiteSteelRain
Copy link

Stuck an afternoon almost....

i was using lightseq to accerlate fairseq.it support fairseq0.10.2,and i want to keep my fairseq0.12.2.

so when running lightseq's criterion's init,error bumped:'TranslationTask' object has no attribute 'args'

after seeing the error,i found where it took place:

    config = LSCrossEntropyLayer.get_config(
        max_batch_tokens=task.args.max_tokens,
        padding_idx=self.padding_idx,
        epsilon=label_smoothing,
        fp16=task.args.fp16,
        local_rank=task.args.device_id,
    )
    self.ls_cross_entropy = LSCrossEntropyLayer(config)

so i thought it must because version,the 0.12.2 remove task.args.

so i went to fairseq_criterion.py,find that current version use cfg instead of args
and i also see an legacy fairseq class warning that dont use args use cfg instead(sth like that)

so the dumbest idea and also direct est idea,print it dir out
and i didnt find the cfg have "max_tokens,","device_id","fp16"....

so i am really seeking help that if anyone know in fairseq0.12.2,where is the'args'?any similar that contains those args above?

i'll be really appreciated.

  • fairseq Version 0.12.2

  • PyTorch Version 2.0.0

  • fairseq (source):

  • Python version:3.9

  • CUDA/cuDNN version: 11.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant