facebookresearch / craftassist

A virtual assistant bot in Minecraft
MIT License
610 stars 78 forks source link

Successfully run agents but the model and dataset are loaded incorrectly #50

Closed hepengfe closed 3 years ago

hepengfe commented 3 years ago

Every time I run agent by python ./python/craftassist/craftassist_agent.py, it prompts me to download the models and datasets. Even after I downloaded them, when I type instructions it says models are not available.

The prompt is as below.

Local models directory is out of sync. Would you like to download the updated files from AWS? This overwrites python/craftassist/models/

The error is as below.

2020-11-07 22:04:13,970 [nsp_dialogue_manager.py:75 - __init__() INFO]: using model_dir=./python/craftassist/models/semantic_parser/ttad_bert_updated/
Traceback (most recent call last):
  File "./python/craftassist/craftassist_agent.py", line 344, in <module>
    sa = CraftAssistAgent(opts)
  File "./python/craftassist/craftassist_agent.py", line 72, in __init__
    super(CraftAssistAgent, self).__init__(opts)
  File "/craftassist/python/craftassist/../base_agent/loco_mc_agent.py", line 26, in __init__
    super(LocoMCAgent, self).__init__(opts, name=self.name)
  File "/craftassist/python/craftassist/../base_agent/core.py", line 12, in __init__
    self.init_controller()
  File "./python/craftassist/craftassist_agent.py", line 119, in init_controller
    self.dialogue_manager = NSPDialogueManager(self, dialogue_object_classes, self.opts)
  File "/craftassist/python/craftassist/../base_agent/nsp_dialogue_manager.py", line 84, in __init__
    action_tree_path=opts.nsp_grammar_path,
  File "/craftassist/python/craftassist/../base_agent/ttad/ttad_model/ttad_model_wrapper.py", line 26, in __init__
    use_cuda=cuda,
  File "/craftassist/python/craftassist/../base_agent/ttad/ttad_model/emnlp_model/prediction_model.py", line 446, in load_model
    with open("%s.args.pk" % (model_name,), "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: './python/craftassist/models/semantic_parser/ttad/ttad.args.pk'

So later I tried to download outside the container by using cmd provided in readme. The issue remains.

curl http://craftassist.s3-us-west-2.amazonaws.com/pubr/models_folder.tar.gz -o models_folder.tar.gz
tar -xzvf models_folder.tar.gz -C python/craftassist/models/ --strip-components 1
curl http://craftassist.s3-us-west-2.amazonaws.com/pubr/ground_truth_data.txt -o python/craftassist/ground_truth_data.txt
Rebecca-Qian commented 3 years ago

Hi @feipenghe, this was fixed in PR #51. Thanks for flagging!