facebookresearch / ParlAI

A framework for training and evaluating AI models on a variety of openly available dialogue datasets.
https://parl.ai
MIT License
10.48k stars 2.09k forks source link

ModuleNotFoundError: No module named 'parlai.agents.transformer_classifier' #4099

Closed yana-xuyan closed 3 years ago

yana-xuyan commented 3 years ago

Bug description Please enter a clear and concise description of what the bug is.

When running parlai eval_model -t dialogue_safety:adversarial --round 3 -dt test -mf zoo:dialogue_safety/single_turn/model -bs 40, got the error "ModuleNotFoundError: No module named 'parlai.agents.transformer_classifier'".

Reproduction steps Enter steps to reproduce the behavior.

parlai version: 1.5.0 parlai eval_model -t dialogue_safety:adversarial --round 3 -dt test -mf zoo:dialogue_safety/single_turn/model -bs 40

Expected behavior Give a clear and concise description of what you expected to happen.

Logs Please paste the command line output: Traceback (most recent call last): File "/home/xuyan/anaconda3/envs/safety/bin/parlai", line 8, in sys.exit(main()) File "/home/xuyan/anaconda3/envs/safety/lib/python3.7/site-packages/parlai/main.py", line 14, in main superscript_main() File "/home/xuyan/anaconda3/envs/safety/lib/python3.7/site-packages/parlai/core/script.py", line 316, in superscript_main opt = parser.parse_args(args) File "/home/xuyan/anaconda3/envs/safety/lib/python3.7/site-packages/parlai/core/params.py", line 1163, in parse_args self.add_extra_args(args) File "/home/xuyan/anaconda3/envs/safety/lib/python3.7/site-packages/parlai/core/script.py", line 175, in add_extra_args sa.choices[args[0]].add_extra_args(args) File "/home/xuyan/anaconda3/envs/safety/lib/python3.7/site-packages/parlai/core/params.py", line 948, in add_extra_args self.add_model_subargs(model, partial) File "/home/xuyan/anaconda3/envs/safety/lib/python3.7/site-packages/parlai/core/params.py", line 822, in add_model_subargs agent = load_agent_module(model) File "/home/xuyan/anaconda3/envs/safety/lib/python3.7/site-packages/parlai/core/loader.py", line 188, in load_agent_module my_module = importlib.import_module(module_name) File "/home/xuyan/anaconda3/envs/safety/lib/python3.7/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 953, in _find_and_load_unlocked File "", line 219, in _call_with_frames_removed File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 965, in _find_and_load_unlocked ModuleNotFoundError: No module named 'parlai.agents.transformer_classifier'

Output goes here

Additional context Add any other context about the problem here. (like proxy settings, network setup, overall goals, etc.)

yana-xuyan commented 3 years ago

Problem solved! The command line should be "parlai eval_model -t dialogue_safety:adversarial --round 3 -dt test -m transformer/classifier -mf zoo:dialogue_safety/single_turn/model -bs 40".

The Parlai document should be updated.

liangzid commented 2 years ago

Sorry but it looks like both these two commands cannot work in my computer while it raised the same error as above... I have tested the parlai version both in 1.5.0 and 1.6.0 ...

klshuster commented 2 years ago

could you please paste your exact command and stack trace?