Python: TypeError: unsupported operand type(s) for +=: 'float' and 'list'
Closed this issue · 6 comments
Multi-hopComplexKBQA/code/KBQA_Runner.py
Line 253 in df6bf3f
I'm using Python 3.7.6. There's an error when I'm trying to run:
TypeError: unsupported operand type(s) for +=: 'float' and 'list'
I guess it should be topic_score = topic_score + 0. if ...
May I know which dataset you are running?
May I know which dataset you are running?
I'm running it on dataset CQ.
Can you print out ''te[w][0]'' or ''te[w]''?
Can you print out ''te[w][0]'' or ''te[w]''?
they are [0.003073975978407299, 'anger management']
and 0.003073975978407299
respectively.
I haven't encountered such an issue. I think the problem is that the 'topic_score' is a list in your case, but I have set it as a scalar at the beginning, can you double-check whether 'tokenizer.dataset' is 'CQ' or the 'topic_score' is a scalar?
I haven't encountered such an issue. I think the problem is that the 'topic_score' is a list in your case, but I have set it as a scalar at the beginning, can you double-check whether 'tokenizer.dataset' is 'CQ' or the 'topic_score' is a scalar?
I found that tokenizer.data is wrong...
Because the data
is not a subdirectory of code
, so I changed the default program parameter in the .sh
and obtained the wrong value.
I've fixed this issue and thanks a lot.