facebookresearch / fairseq

Facebook AI Research Sequence-to-Sequence Toolkit written in Python.
MIT License
30.49k stars 6.41k forks source link

help running tutorial at examples/MMPT #4347

Closed yonatanshemeshhuji closed 2 years ago

yonatanshemeshhuji commented 2 years ago

I'm trying to run the simple tutorial given here: https://github.com/pytorch/fairseq/tree/main/examples/MMPT . Unfortunately, I get Omegaconf exceptions.

What I have tried:

python3 -m venv testenv source testenv/bin/activate now, testenv is activated

git clone https://github.com/pytorch/fairseq cd fairseq pip install -e . export MKL_THREADING_LAYER=GNU
cd examples/MMPT pip install -e . pip install transformers==3.4 mkdir pretrained_models // pretrained_models located under MMPT/.. cd pretrained_models; wget https://www.rocq.inria.fr/cluster-willow/amiech/howto100m/s3d_howto100m.pth wget https://www.rocq.inria.fr/cluster-willow/amiech/howto100m/s3d_dict.npy
now I have:

>> ls pretrained_models/
s3d_howto100m.pth
s3d_dict.npy

under examples/MMPT, I run: mkdir -p runs/retri/videoclip cd runs/retri/videoclip; wget https://dl.fbaipublicfiles.com/MMPT/retri/videoclip/checkpoint_best.pt


>> ls runs/retri/videoclip/
checkpoint_best.pt.1

Finally, python locallaunch.py projects/retri/videoclip.yaml --dryrun

and I get: Traceback (most recent call last): File "locallaunch.py", line 148, in main(args) File "locallaunch.py", line 128, in main pipelines = [Pipeline(fn) for fn in args.yamls.split(",")] File "locallaunch.py", line 128, in pipelines = [Pipeline(fn) for fn in args.yamls.split(",")] File "locallaunch.py", line 54, in init job_config = recursive_config(fn) File "..../fairseq/examples/MMPT/mmpt/utils/load_config.py", line 61, in recursive_config base_config = recursive_config(includes) File "..../fairseq/examples/MMPT/mmpt/utils/load_config.py", line 62, in recursive_config config = OmegpretrainedaConf.merge(base_config, config) NameError: name 'OmegpretrainedaConf' is not defined

I tried upgrading omegaconf:

pip install omegaconf==2.1.1

but now after running:

Traceback (most recent call last): File "locallaunch.py", line 148, in main(args) File "locallaunch.py", line 128, in main pipelines = [Pipeline(fn) for fn in args.yamls.split(",")] File "locallaunch.py", line 128, in pipelines = [Pipeline(fn) for fn in args.yamls.split(",")] File "locallaunch.py", line 54, in init job_config = recursive_config(fn) ....... ...... omegaconf.errors.ConfigAttributeError: Missing key includes full_key: includes object_type=dict

my os is linux, python 3.7.3 and installation was described above. Probably I'm doing something wrong. Any help would be much appreciated!

yonatanshemeshhuji commented 2 years ago

I have no idea why, ran it today again on some existing venv and it succeeded. For anybody it may help in the future: on the existing venv (where the code worked): python version is 3.7.3 omegaconf is 2.0.6 torch version is 1.9.0+cu102

armalko commented 1 year ago

Had similar issue when running python locallaunch.py projects/retri/videoclip.yaml --dryrun. Got NameError: name 'BertEmbeddings' is not defined. I just unwrapped transforms imports in mm.py file from try except close and it worked. It happens because of naming in transforms. Use transformers.models.bert.modeling_bertrather than transformers.modeling_bert (you should manually change it in files where NameError occurs)

EmreOzkose commented 1 year ago

Hi @yonatanshemeshhuji , do you know that how can I download data/youcook/youcook_val.pkl ?