fairseq icon indicating copy to clipboard operation
fairseq copied to clipboard

ImportError: cannot import name 'hyperparam' from 'sweep' ...

Open ican24 opened this issue 1 year ago • 2 comments

❓ Questions and Help

Before asking:

  1. search the issues.
  2. search the docs.

What is your question?

Hi, I can not run fine-tuning with NLLB200 setting.

Code

What have you tried?

I am trying to fine-tune with NLLB200 setting

DROP=0.1
python examples/nllb/modeling/train/train_script.py \
    cfg=nllb200_dense3.3B_finetune_on_fbseed \
    cfg/dataset=fbseed_chat.yaml \
    cfg.dataset.lang_pairs="eng_Latn-hye_Armn" \
    cfg.fairseq_root=$(pwd) \
    cfg.output_dir=output \
    cfg.dropout=$DROP \
    cfg.warmup=10 \
    cfg.finetune_from_model=fairseq/model/nllb200dense3bcheckpoint

But I am getting error:

ImportError: cannot import name 'hyperparam' from 'sweep' (/home/arm2/.local/lib/python3.10/site-packages/sweep/init.py)

I am trying to find any note about "from sweep import hyperparam", which is used in examples/nllb/modeling/sweet/sweet_mmt.py, but yet it is not successful.

What's your environment?

  • fairseq Version: 0.12.2:
  • PyTorch Version: 2.1.1
  • OS (e.g., Linux): Ubuntu 22.04
  • How you installed fairseq: pip:
  • Build command you used: no
  • Python version: 3.10
  • CUDA/cuDNN version: 12.3
  • GPU models and configuration:
  • Any other relevant information:

Could you please advise me? Thank you in advance!

ican24 avatar Nov 25 '23 11:11 ican24

The sweep package of pip (https://pypi.org/project/sweep/) has no 'hyperparam' function. It is a biological module! I could not find similar package with 'hyperparam' function. Is there a mistake of fairseq developers or something else?

ican24 avatar Nov 26 '23 06:11 ican24

The Facebook team did a lot of effort to write this instruction: https://github.com/facebookresearch/fairseq/tree/nllb/examples/nllb/modeling But it is not working because of trivial mistakes. Why? Why you did such useless job? Is it not a big corporation reputation issue?

ican24 avatar Nov 28 '23 06:11 ican24

@ican24 did you find a solution?

BorisovMaksim avatar Jan 08 '24 22:01 BorisovMaksim

Yes, we used recommendations from this page: https://huggingface.co/learn/nlp-course/chapter7/4?fw=tf If you'll meet trouble, I'll send you ready script as template by email.

ican24 avatar Jan 08 '24 22:01 ican24