ImageCaptioning.pytorch
ImageCaptioning.pytorch copied to clipboard
Python-3 support
Hi @ruotianluo ,
I looked at the coco-caption codebase.
It seems that we need some modifications like xrange
-> range
etc., to port the code to Python-3.
So, I'd like to know if you have any plans to port the pycoco
tools to Python-3 so that we can use this current codebase for training models in Python-3?
It's harder than that. I tried and failed for some metric.
I see. Let me try to do that and issue a PR if I manage to do it successfully!
I have implemented Python 3 support for the coco caption metrics: https://github.com/salaniz/pycocoevalcap
I decided against a PR and in favor of a fork of my own because the pycocotools that come with the original repository have diverged with the newest version present in the coco API repository here: https://github.com/cocodataset/cocoapi
Therefore, I am using the pycocotools from the API repository together with my updated caption evaluation code.
You can have a look at the changes. They are all pretty obvious, except maybe the Meteor one which took me a while to debug. If you have any problems, let me know. Also feel free to make a PR with my changes. I have not tested if my code is backward compatible with Python 2.7.
cool, I'll take a look.
I have implemented Python 3 support for the coco caption metrics: https://github.com/salaniz/pycocoevalcap
I decided against a PR and in favor of a fork of my own because the pycocotools that come with the original repository have diverged with the newest version present in the coco API repository here: https://github.com/cocodataset/cocoapi
Therefore, I am using the pycocotools from the API repository together with my updated caption evaluation code.
You can have a look at the changes. They are all pretty obvious, except maybe the Meteor one which took me a while to debug. If you have any problems, let me know. Also feel free to make a PR with my changes. I have not tested if my code is backward compatible with Python 2.7.
hi, thank you for your work! Does your new repo support Chinese language evaluation?
My repository simply adds Python 3 support, but leaves everything else unchanged. So it is really up to how well the metrics and the tokenizer from the original coco-caption repo generalize to the Chinese language. I do not know if that's the case.
I added py3 support here https://github.com/ruotianluo/self-critical.pytorch/tree/py3 .
@ruotianluo thanks a lot! It seems the doc is still to be updated, right?
@kmario23 I'm not yet 100% percent sure if it's correct. It seems working well on my side now.