mmf
mmf copied to clipboard
how to run it with python script?
❓ Questions and Help
base on image, I run it using the script below
from mmf_cli.run import run opts = [ "config=projects/m4c/configs/textvqa/defaults.yaml", "model=m4c", "dataset=textvqa", "run_type=train_val", ] run(opts)
But the errors I get are as follows, how to run it with python script?
/opt/conda/lib/python3.8/site-packages/omegaconf/grammar_visitor.py:253: UserWarning: In the sequence
MMF_USER_DIR,some elements are missing: please replace them with empty quoted strings. See https://github.com/omry/omegaconf/issues/572 for details. warnings.warn( /opt/conda/lib/python3.8/site-packages/omegaconf/resolvers/__init__.py:12: UserWarning: The
envresolver is deprecated, see https://github.com/omry/omegaconf/issues/573 warnings.warn( 2022-01-10T06:31:21 | mmf.utils.configuration: Overriding option config to projects/m4c/configs/textvqa/defaults.yaml 2022-01-10T06:31:21 | mmf.utils.configuration: Overriding option model to m4c 2022-01-10T06:31:21 | mmf.utils.configuration: Overriding option datasets to textvqa 2022-01-10T06:31:21 | mmf.utils.configuration: Overriding option run_type to train_val /opt/conda/lib/python3.8/site-packages/omegaconf/grammar_visitor.py:253: UserWarning: In the sequence
MMF_LOG_DIR,some elements are missing: please replace them with empty quoted strings. See https://github.com/omry/omegaconf/issues/572 for details. warnings.warn( /opt/conda/lib/python3.8/site-packages/omegaconf/grammar_visitor.py:253: UserWarning: In the sequence
MMF_REPORT_DIR,some elements are missing: please replace them with empty quoted strings. See https://github.com/omry/omegaconf/issues/572 for details. warnings.warn( /opt/conda/lib/python3.8/site-packages/omegaconf/grammar_visitor.py:253: UserWarning: In the sequence
MMF_TENSORBOARD_LOGDIR,some elements are missing: please replace them with empty quoted strings. See https://github.com/omry/omegaconf/issues/572 for details. warnings.warn( /opt/conda/lib/python3.8/site-packages/omegaconf/grammar_visitor.py:253: UserWarning: In the sequence
MMF_WANDB_LOGDIR,some elements are missing: please replace them with empty quoted strings. See https://github.com/omry/omegaconf/issues/572 for details. warnings.warn( /opt/conda/lib/python3.8/site-packages/omegaconf/grammar_visitor.py:253: UserWarning: In the sequence
MMF_USER_DIR,some elements are missing: please replace them with empty quoted strings. See https://github.com/omry/omegaconf/issues/572 for details. warnings.warn( /opt/conda/lib/python3.8/site-packages/omegaconf/resolvers/__init__.py:12: UserWarning: The
envresolver is deprecated, see https://github.com/omry/omegaconf/issues/573 warnings.warn( /opt/conda/lib/python3.8/site-packages/omegaconf/grammar_visitor.py:253: UserWarning: In the sequence
MMF_USER_DIR,some elements are missing: please replace them with empty quoted strings. See https://github.com/omry/omegaconf/issues/572 for details. warnings.warn( /opt/conda/lib/python3.8/site-packages/omegaconf/resolvers/__init__.py:12: UserWarning: The
envresolver is deprecated, see https://github.com/omry/omegaconf/issues/573 warnings.warn( 2022-01-10T06:31:27 | mmf.utils.configuration: Overriding option config to projects/m4c/configs/textvqa/defaults.yaml 2022-01-10T06:31:27 | mmf.utils.configuration: Overriding option model to m4c 2022-01-10T06:31:27 | mmf.utils.configuration: Overriding option datasets to textvqa 2022-01-10T06:31:27 | mmf.utils.configuration: Overriding option run_type to train_val /opt/conda/lib/python3.8/site-packages/omegaconf/grammar_visitor.py:253: UserWarning: In the sequence
MMF_LOG_DIR,some elements are missing: please replace them with empty quoted strings. See https://github.com/omry/omegaconf/issues/572 for details. warnings.warn( /opt/conda/lib/python3.8/site-packages/omegaconf/grammar_visitor.py:253: UserWarning: In the sequence
MMF_REPORT_DIR,some elements are missing: please replace them with empty quoted strings. See https://github.com/omry/omegaconf/issues/572 for details. warnings.warn( /opt/conda/lib/python3.8/site-packages/omegaconf/grammar_visitor.py:253: UserWarning: In the sequence
MMF_TENSORBOARD_LOGDIR,some elements are missing: please replace them with empty quoted strings. See https://github.com/omry/omegaconf/issues/572 for details. warnings.warn( /opt/conda/lib/python3.8/site-packages/omegaconf/grammar_visitor.py:253: UserWarning: In the sequence
MMF_WANDB_LOGDIR,` some elements are missing: please replace them with empty quoted strings. See https://github.com/omry/omegaconf/issues/572 for details.
warnings.warn(
2022-01-10T06:31:27 | mmf.utils.configuration: Overriding option config to projects/m4c/configs/textvqa/defaults.yaml
2022-01-10T06:31:27 | mmf.utils.configuration: Overriding option model to m4c
2022-01-10T06:31:27 | mmf.utils.configuration: Overriding option datasets to textvqa
2022-01-10T06:31:27 | mmf.utils.configuration: Overriding option run_type to train_val
Traceback (most recent call last):
File "
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
/opt/conda/lib/python3.8/site-packages/omegaconf/grammar_visitor.py:253: UserWarning: In the sequence MMF_LOG_DIR,
some elements are missing: please replace them with empty quoted strings. See https://github.com/omry/omegaconf/issues/572 for details.
warnings.warn(
/opt/conda/lib/python3.8/site-packages/omegaconf/grammar_visitor.py:253: UserWarning: In the sequence MMF_REPORT_DIR,
some elements are missing: please replace them with empty quoted strings. See https://github.com/omry/omegaconf/issues/572 for details.
warnings.warn(
/opt/conda/lib/python3.8/site-packages/omegaconf/grammar_visitor.py:253: UserWarning: In the sequence MMF_TENSORBOARD_LOGDIR,
some elements are missing: please replace them with empty quoted strings. See https://github.com/omry/omegaconf/issues/572 for details.
warnings.warn(
/opt/conda/lib/python3.8/site-packages/omegaconf/grammar_visitor.py:253: UserWarning: In the sequence MMF_WANDB_LOGDIR,
some elements are missing: please replace them with empty quoted strings. See https://github.com/omry/omegaconf/issues/572 for details.
warnings.warn(
Traceback (most recent call last):
File "
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
Traceback (most recent call last):
File "/code/Demo/mmf/test/test1.py", line 28, in
Hi!
This worked for me:
I created a file in the root mmf directory called my_run.py
containing the following:
from mmf_cli.run import run
from mmf_cli.predict import predict
opts = ["config=projects/m4c/configs/textvqa/defaults.yaml",
"datasets=textvqa",
"model=m4c",
"run_type=test",
"checkpoint.resume_zoo=m4c.textvqa.defaults"]
run(opts, predict=False)
Hope it helps!