saahiluppal / catr

Image Captioning Using Transformer
Apache License 2.0
254 stars 53 forks source link

pretrained models issue #4

Closed caprone closed 4 years ago

caprone commented 4 years ago

HI I tried only the pre-trained models, V1 and V3 --> runnning predict.py , but prediction return only a list of "[unk] [unk] [unk] [unk] [unk] [unk] [unk] [unk] [unk] [unk]" on my images dataset;.. what can be the problem??

thanks for your clear code;

caprone commented 4 years ago

ok, issue found; in predict.py file, we need convert tensor returned by evaluate to list, (for tokenizer decode processing)

result = tokenizer.decode(output[0].tolist(), skip_special_tokens=True);

now works perfect; thanks! great project!!