Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do you have Python code #26

Closed
kim-yhow opened this issue Nov 22, 2019 · 13 comments
Closed

Do you have Python code #26

kim-yhow opened this issue Nov 22, 2019 · 13 comments

Comments

@kim-yhow
Copy link

To be honest, I'm not very familiar with Lua code, so I wish you could have a python implementation. It’s very important for me. Thank you very much

@da03
Copy link
Collaborator

da03 commented Nov 25, 2019

yeah we have it implemented in python as well: http://opennmt.net/OpenNMT-py/im2text.html

@da03 da03 closed this as completed Nov 25, 2019
@kim-yhow
Copy link
Author

yeah we have it implemented in python as well: http://opennmt.net/OpenNMT-py/im2text.html

Thank you for your code. And I download the trained model and dataset which the link mentioned. And evaluate it with the test dataset . However the results can not reach the scores mentioned in the paper.
results
tips: the evaluation code is from https://github.com/harvardnlp/im2markup/tree/master/scripts/evaluation
}2WJ0K2V1RLQU)7T4 _0VYS

@da03
Copy link
Collaborator

da03 commented Nov 27, 2019

Hmm interesting. There are some differences between the python code and the lua code, e.g., the batching is different, and the python code is treating images as three channels R,G,B, whereas the lua code converts images to greyscale first which decreases the number of parameters. For reproducing the results in the paper, I'd suggest using the lua code which I'm pretty sure can get the reported accuracy.

@da03 da03 reopened this Nov 27, 2019
@kim-yhow
Copy link
Author

Thanks, I will try to use the lua code. And do you have the model which you have trained by lua code?

@da03
Copy link
Collaborator

da03 commented Nov 27, 2019

Yes see this section: https://github.com/harvardnlp/im2markup#test

@kim-yhow
Copy link
Author

Oh, yeah. I found it, thank you very much! And by the way, I wonder if the trained model in python is the best one. In other word, if I train it for more time, will it perform better?

@da03
Copy link
Collaborator

da03 commented Nov 27, 2019

I'm not sure since I trained it years ago... But please let me know if you can get a pytorch model matching the performance of the luatorch one. (I think it might be possible to convert the luatorch model to pytorch if we manually convert all weights)

@kim-yhow
Copy link
Author

Okey, Thank you!

@kim-yhow
Copy link
Author

Hi, when i run the lua code, I found the following problem.

  1. Why the accuracy is nan? The accuracy of the first 500 is 0.93, however , the following of accuracy is nan
    1
  2. What is the meaning of the following images.
    2
    Thank you very much!

@kim-yhow
Copy link
Author

Thank you very much, and I reproduce the results successfully with lua code.

@da03
Copy link
Collaborator

da03 commented Jan 22, 2020

closing now, please reopen if there are other problems.

@da03 da03 closed this as completed Jan 22, 2020
@PhenomenalOnee
Copy link

This http://opennmt.net/OpenNMT-py/im2text.html
link is not working now
Do you have the python code to run the pre trained
models

@StephenKyung
Copy link

StephenKyung commented May 11, 2021

This http://opennmt.net/OpenNMT-py/im2text.html
link is not working now
Do you have the python code to run the pre trained
models

the link has chnaged! check this :
https://opennmt.net/OpenNMT-py/legacy/im2text.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants