Open Naseemy35 opened 2 years ago
I tested the code again on my Windows computer. The problem here is that you are using CPU version and no GPU for speeding up. As tensor computation will be very slow if you do not use GPU, you might want to use at least one GPU or reduce the eval-batch-size to 1-5.
thanks for helping appreciate it after using the GPU too, I have been trying to keep only the first 5 or 3 questions in the test_set_src folder
in order to see different results but it always responded using the error
" File "run_tpn2f_mathqa.py", line 836, in main score = solve.solve_procedure(info_file_name, src_file_name, predications_test, 1) File "C:\Users\Naseem Yehya\Desktop\paper_suggestion\src\mathqa_exec\solve.py", line 292, in solve_procedure test_data_src, test_data_tgt, test_data_info = read_src_tgt(test_complete_info_file_name, test_src_file_name, pred_file_name, n_best_check) File "C:\Users\Naseem Yehya\Desktop\paper_suggestion\src\mathqa_exec\solve.py", line 81, in read_src_tgt test_data_info.append(total_set_mapping[test_data_src[i]]) KeyError: 'the present population of a town is 3888 . population increase rate is 20 % p . a . find the population of town before 2 years '"
I would be glad if you can tell me how to run my own tests Thanks in advance
I am not quite sure how did you get this error. I tested it on my computer and the codes worked fine. The evaluation code has two parts. The first part is generating the program and the generated programs are stored in results/test_predications.txt. Then, the second is executing the programs via a script to compute execution accuracy. For the first part, the data is actually loaded from the binary_test.json file. Thus, if you want to try your own data, you might want to create a json file with the same format as the binary_test.json. The execution script is from the author of MathQA dataset and I did not modify it. Thus, to execute the program, you need all the files in the data/mathqa folder. If you want to execute your own program, you might need to hack the codes in the src\mathqa_exec folder. If you want to create an application to generate a program given a question, you might want to modify your data input, run the model, and use the dictionary to convert model outputs back to tokens.
By the way, in the second part (program execution), you cannot simply modify the "test_set_src.txt" file, because the execution script uses a dictionary to check the program of a question and find the mult-choices answer (you need to modify all other data files used in the script accordingly). Thus, if you just want to generate the program, just comment out the codes starting from the line "score = solve.solve_procedure(info_file_name, src_file_name, predications_test, 1)" to the end of that function in "run_tpn2f_mathqa.py" file.
I changed the necessary files : "test_set_src" + "test" + "binary_test" to have only the first three problems to test, still I have similar problem with the dictionary should I change another file because I tried changing the code but in the end used the original one
thanks in advance, Naseem
whenever I run your command using the CMD whether it's MathQA or AlgoLisp it always prints this line at the end and nothing happens next, I hoped it would continue after a couple of hours but it didn't and I couldn't fix the code.
"C:\Users\Naseem Yehya\Desktop\paper_suggestion\src\model.py:481: UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument. word_probs = F.softmax(logits_reshape)"
I would be glad if you some advice\guidance regarding this topic, thanks in advance.