cmustrudel / dire Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hi, I'm reading the source code and struggeling to see if I can use DIRE to predict the names of functions.
Is this possible and what would be the best way to achieve this?
Thanks.
@pcyin's original repository does:
(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
In the readme file of neural model:
"conda env install -f data/env.yml"
should be
"conda env create -f data/env.yml"
Training command line does not include dev set:
python exp.py \
train \
--cuda \
--work-dir=exp_runs/dire.hybrid \
--extra-config='{ "data": {"train_file": "data/preprocessed_data/train-shard-*.tar" }, "decoder": { "input_feed": false, "tie_embedding": true }, "train": { "evaluate_every_nepoch": 5, "max_epoch": 60 } }' \
data/config/model.hybrid.jsonnet
Fixed in ed-wip
branch, close when merged.
DWARF is currently used for more than variable naming during dataset generation. We may be able to improve alignment if we can disable DWARF use for calling conventions. The IDA GUI prompts for some of these, but I don't see a way to control this in batch mode.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.