ParlAI icon indicating copy to clipboard operation
ParlAI copied to clipboard

ModuleNotFoundError: No module named 'projects.md_gender'

Open davidfrankenberg opened this issue 3 years ago • 5 comments

Bug description Hi, I have been trying to run the Md Gender pre-trained model from the zoo but no matter how hard I try I always get an error.

Reproduction steps For example, an attempt to execute the example in the documentation:

parlai interactive -t md_gender -m projects.md_gender.bert_ranker_classifier.agents:BertRankerClassifierAgent -mf zoo:md_gender/model -ecands inline -cands inline --interactive_mode False --data-parallel False

Expected behavior The documentation shows the following expected output:

Enter Your Message: Hi my name is Emily!
[MDGender Classifier]: SELF: female

Logs

Traceback (most recent call last):
  File "/usr/local/bin/parlai", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/dist-packages/parlai/__main__.py", line 14, in main
    superscript_main()
  File "/usr/local/lib/python3.7/dist-packages/parlai/core/script.py", line 316, in superscript_main
    opt = parser.parse_args(args)
  File "/usr/local/lib/python3.7/dist-packages/parlai/core/params.py", line 1163, in parse_args
    self.add_extra_args(args)
  File "/usr/local/lib/python3.7/dist-packages/parlai/core/script.py", line 175, in add_extra_args
    sa.choices[args[0]].add_extra_args(args)
  File "/usr/local/lib/python3.7/dist-packages/parlai/core/params.py", line 940, in add_extra_args
    self.add_task_args(task, partial)
  File "/usr/local/lib/python3.7/dist-packages/parlai/core/params.py", line 849, in add_task_args
    agent = load_teacher_module(t)
  File "/usr/local/lib/python3.7/dist-packages/parlai/core/loader.py", line 281, in load_teacher_module
    task_module = load_task_module(taskname)
  File "/usr/local/lib/python3.7/dist-packages/parlai/core/loader.py", line 247, in load_task_module
    task_module = importlib.import_module(module_name)
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'projects.md_gender'

Additional context I tried to execute it locally, in colab and databricks. The above log comes from colab.

davidfrankenberg avatar Jul 13 '22 14:07 davidfrankenberg

what version of parlai are you using? could you try upgrading?

klshuster avatar Jul 21 '22 13:07 klshuster

I'm using the version 1.6.0

davidfrankenberg avatar Jul 21 '22 14:07 davidfrankenberg

could you possibly try reinstalling? Additionally, not sure how it is relevant to this issue, but note that ParlAI currently supports python 3.8+

klshuster avatar Jul 25 '22 16:07 klshuster

I have tried reinstalling but the problem remains the same.

davidfrankenberg avatar Aug 02 '22 11:08 davidfrankenberg

could you try installing from source?

klshuster avatar Aug 08 '22 22:08 klshuster

The same

davidfrankenberg avatar Aug 16 '22 07:08 davidfrankenberg

can you show me the full install procedure + stack trace? this should work if installed from source

klshuster avatar Aug 17 '22 19:08 klshuster

This issue has not had activity in 30 days. Please feel free to reopen if you have more issues. You may apply the "never-stale" tag to prevent this from happening.

github-actions[bot] avatar Sep 17 '22 00:09 github-actions[bot]