spcl / ncc

Neural Code Comprehension: A Learnable Representation of Code Semantics
BSD 3-Clause "New" or "Revised" License
206 stars 51 forks source link

[train_task_classifyapp.py] Cannot sample 1500 from 0 files found in task/classifyapp/ir_train/1 #4

Closed GostD closed 5 years ago

GostD commented 5 years ago

I called python train_task_classifyapp.py and got this output:

Evaluating ClassifyappInst2Vec ...
Getting file names for 104 classes from folders:
task/classifyapp/ir_train
task/classifyapp/ir_val
task/classifyapp/ir_test
    training  : Read file names from folder  task/classifyapp/ir_train/1
 Traceback (most recent call last):
  File "train_task_classifyapp.py", line 478, in <module>
    app.run(main)
  File "/home/selp/.local/lib/python3.6/site-packages/absl/app.py", line 300, in run
    _run_main(main, args)
  File "/home/selp/.local/lib/python3.6/site-packages/absl/app.py", line 251, in _run_main
    sys.exit(main(argv))
  File "train_task_classifyapp.py", line 470, in main
    dense_layer_size, print_summary, num_epochs, batch_size)
  File "train_task_classifyapp.py", line 289, in evaluate
    len(seq_files)) + " files found in " + folder
AssertionError: Cannot sample 1500 from 0 files found in task/classifyapp/ir_train/1
GostD commented 5 years ago

As far as I understand, this line

classifyapp_accuracy = evaluate(NCC_classifyapp(), embeddings, folder_data, 
    train_samples, folder_results, dense_layer_size,
    print_summary, num_epochs, batch_size)

should be replaced with this line

classifyapp_accuracy = evaluate(NCC_classifyapp(), embeddings, "task/classifyapp/seq", 
    train_samples, folder_results, dense_layer_size, 
    print_summary, num_epochs, batch_size)

Am I right?

tbennun commented 5 years ago

Hi @GostD,

Did you extract the dataset in the correct folder? As mentioned in the README, it can be found at: https://polybox.ethz.ch/index.php/s/JOBjrfmAjOeWCyl