VCML
VCML copied to clipboard
"KeyError: 'program_parsed'" when running the program
Hi. I tried to test the pretrained model using the test data from CLEVR dataset but had a error 'KeyError: 'program_parsed''. The command I typed in is as follows.
jac-crun 0 scripts/main.py --mode run-experiment --task CLEVR --model VCML --experiment synonym_generalization --log_dir ../data/log --data_dir ../data/ --pretrained --in_epoch test
and the error message shown is as follows.
0:00:52.63 | => epoch 0
|
0:00:52.85 | -----> Testing
Traceback (most recent call last):
File "scripts/main.py", line 44, in
/home/dule/Desktop/NN/AAAI_21/nuero-symbolic_ai/VCML/models/model/vcml_model.py(87)forward() 85 program_encoded = data['program_encoded'] 86 else: ---> 87 program = data['program_parsed'] 88 program_encoded = data['program_parsed_encoded'] 89
ipdb>
Any suggestions how to fix this issue? Thank you very much!
Getting the same error. If I modify 'inner()' function in train.py when 'is_train=False' to estimate 'program parsed' and 'program_parsed_encoded' just like when 'is_train=True' , the code will proceed further, but will fail as the downloaded parser cannot parse test questions. That is, the first 10 questions from the test set:
# Out[93]: TEST QUESTIONS
# ['Is small a synonym of small?',
# 'Is sphere a synonym of sphere?',
# 'Is shiny a synonym of shiny?',
# 'Is sphere a synonym of shiny?',
# 'Is sphere a synonym of small?',
# 'Is shiny a synonym of shiny?',
# 'Is shiny a synonym of sphere?',
# 'Is small a synonym of shiny?',
# 'Is shiny a synonym of small?',
# 'Is small a synonym of small?']
And the parser will process them in the following way (showing the first two):
# Out[96]:
# [[{'operation': '<END>', 'argument': 'small'},
# {'operation': '<END>', 'argument': 'small'},
# {'operation': '<END>', 'argument': '<END>'},
# {'operation': '<END>', 'argument': '<END>'},
# {'operation': '<END>', 'argument': '<END>'}],
# [{'operation': '<END>', 'argument': 'sphere'},
# {'operation': '<END>', 'argument': 'sphere'},
# {'operation': '<END>', 'argument': '<END>'},
# {'operation': '<END>', 'argument': '<END>'},
# {'operation': '<END>', 'argument': '<END>'}],
Could you please have a look at this? I suspect the parser provided cannot process meta concept words like 'synonym'..
Update to my previous comment: have been testing the parser separately, and while in parser.tools.operation.records it contains 'synonym', it is always predicting '10' for operation, which is '<END>' for the test questions. Below listing parser operatons.
['select_concept',
'synonym',
'isinstanceof',
'samekind',
'select_object',
'filter',
'exist',
'classify',
'<NULL>',
'<START>',
'<END>',
'<UNK>']
Same issue here. @anette123 may I know if you have solved this problem?
I'd also like to call for the authors' attention to this issue @vacancy @Glaciohound