Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pretrained models don't contain vocab files #3

Open
edmcman opened this issue Sep 14, 2020 · 0 comments
Open

Pretrained models don't contain vocab files #3

edmcman opened this issue Sep 14, 2020 · 0 comments
Assignees

Comments

@edmcman
Copy link
Collaborator

edmcman commented Sep 14, 2020

(venv) ed@ed-Precision-7540:~/Documents/DIRE/neural-model$ python exp.py test --cuda --extra-config='{"decoder": {"remove_duplicates_in_prediction": true} }' '/media/ed/Dell Portable Hard Drive/dire-data/pretrained_models/data/saved_models/model.hybrid.bin' '/media/ed/Dell Portable Hard Drive/dire-data/preprocessed_splits/test.tar'
Main process id 9942
use random seed 0
loading model from [/media/ed/Dell Portable Hard Drive/dire-data/pretrained_models/data/saved_models/model.hybrid.bin]
{'gnn': {'hidden_size': 128, 'layer_timesteps': [8], 'residual_connections': {'0': [0]}}, 'connections': ['top_down', 'bottom_up', 'terminals', 'variable_master_nodes', 'func_root_to_arg'], 'vocab_file': 'data/all_trees_tokenized_0410/vocab.bpe10000.old_gnn/vocab', 'bpe_model_path': None, 'node_syntax_type_embedding_size': 64, 'node_type_embedding_size': 64, 'node_content_embedding_size': 128, 'init_with_seq_encoding': False, 'decoder_hidden_size': 256, 'dropout': 0.2}
Traceback (most recent call last):
  File "exp.py", line 217, in <module>
    test(cmd_args)
  File "exp.py", line 186, in test
    model = model_cls.load(model_path, use_cuda=args['--cuda'], new_config=extra_config)
  File "/home/ed/Documents/DIRE/neural-model/model/model.py", line 149, in load
    model = cls.build(config, **kwargs)
  File "/home/ed/Documents/DIRE/neural-model/model/model.py", line 64, in build
    encoder = globals()[config['encoder']['type']].build(config['encoder'])
  File "/home/ed/Documents/DIRE/neural-model/model/hybrid_encoder.py", line 51, in build
    return cls(params)
  File "/home/ed/Documents/DIRE/neural-model/model/hybrid_encoder.py", line 23, in __init__
    self.graph_encoder = GraphASTEncoder.build(config['graph_encoder'])
  File "/home/ed/Documents/DIRE/neural-model/model/graph_encoder.py", line 107, in build
    vocab = Vocab.load(params['vocab_file'])
  File "/home/ed/Documents/DIRE/neural-model/utils/vocab.py", line 170, in load
    params = json.load(open(path, 'r'))
FileNotFoundError: [Errno 2] No such file or directory: 'data/all_trees_tokenized_0410/vocab.bpe10000.old_gnn/vocab'

This is using the model from http://www.cs.cmu.edu/~pengchey/dire_models.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant