facebookresearch / mmf

A modular framework for vision & language multimodal research from Facebook AI Research (FAIR)
https://mmf.sh/
Other
5.48k stars 935 forks source link

Error in [colab-mmf_hm_example.ipynb] KeyError: "Required argument 'model' not passed" #432

Closed jithendray closed 4 years ago

jithendray commented 4 years ago

❓ Questions and Help

!mmf_predict config=projects/hateful_memes/configs/mmbt/defaults.yaml \ model=mmbt \ dataset=hateful_memes \ run_type=test \ checkpoint.resume_zoo=mmbt.hateful_memes.images \ training.batch_size=16

When I am running this colab notebook provided - I am getting this error:

2020-07-27 05:55:59.896091: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1 Namespace(config_override=None, local_rank=None, opts=['config=projects/hateful_memes/configs/mmbt/defaults.yaml', ' model=mmbt', ' dataset=hateful_memes', ' run_type=test', ' checkpoint.resume_zoo=mmbt.hateful_memes.images', ' training.batch_size=16', 'evaluation.predict=true']) /usr/local/lib/python3.6/dist-packages/mmf/utils/configuration.py:528: UserWarning: Device specified is 'cuda' but cuda is not present. Switching to CPU version. + "Switching to CPU version." Traceback (most recent call last): File "/usr/local/bin/mmf_predict", line 8, in sys.exit(predict()) File "/usr/local/lib/python3.6/dist-packages/mmf_cli/predict.py", line 15, in predict run(predict=True) File "/usr/local/lib/python3.6/dist-packages/mmf_cli/run.py", line 80, in run configuration = Configuration(args) File "/usr/local/lib/python3.6/dist-packages/mmf/utils/configuration.py", line 210, in init other_configs = self._build_other_configs() File "/usr/local/lib/python3.6/dist-packages/mmf/utils/configuration.py", line 234, in _build_other_configs model_config = self._build_model_config(opts_config) File "/usr/local/lib/python3.6/dist-packages/mmf/utils/configuration.py", line 279, in _build_model_config raise KeyError("Required argument 'model' not passed") KeyError: "Required argument 'model' not passed"

vedanuj commented 4 years ago

Can you try removing the \ from the command and try again? Also you should enable GPU runtime in your colab.

jithendray commented 4 years ago

I enabled GPU on the runtime, and which \ should I remove? There are many! and why is this showing up? Device specified is 'cuda' but cuda is not present. Switching to CPU version. + "Switching to CPU version

Also there is no folder like this - /usr/local/lib/python3.6/dist-packages/mmf/utils/configuration in my laptop - there is python3.8 instead of 3.6

vedanuj commented 4 years ago

Try this

!mmf_predict config=projects/hateful_memes/configs/mmbt/defaults.yaml  model=mmbt  dataset=hateful_memes  run_type=test  checkpoint.resume_zoo=mmbt.hateful_memes.images training.batch_size=16

Are you running this on colab or your own laptop?

jithendray commented 4 years ago

Try this

!mmf_predict config=projects/hateful_memes/configs/mmbt/defaults.yaml  model=mmbt  dataset=hateful_memes  run_type=test  checkpoint.resume_zoo=mmbt.hateful_memes.images training.batch_size=16

This worked now, thanks. I am using colab.