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

[MERGE SECOND!] Ridiculous implementation of the Show and Tell model #7

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

leesharma
Copy link
Owner

@leesharma leesharma commented Oct 12, 2018

I'm having a ton of unexpected trouble getting the beam search to work right in Java, so here's a super hacked together—but functional!—implementation using both Java and Python. It requires more dependencies, but it is at least a working product.

Dependencies:

  • Bazel
  • Python
  • TensorFlow (python) > 1.0
  • Maven

Getting Started:

bin/install.osx.sh && bin/build.sh && bin/run.sh

Demo: (click to view)
Video demo of the program working.

Turns out that these were in the wrong format. Stay tuned for the
*actual* model files.
We've verified that this works on all systems, so we're ready to
actually integrate TensorFlow into the app.
Apparently the model is too big for git, so let's try git lfs. This is
just setting up the large file tracking.
This commit adds the trained (2M iter) tensorflow model to the
resources directory.

Because of their large size, the model files are managed by git lfs.
To download them:
  1. Download git-lfs (https://git-lfs.github.com/)
  2. Run `git lfs pull`
    2a. If that doesn't work, try deleting `src/main/resources/model`
        and trying again

If that doesn't work, I also added a shell script to download the
files: `bin/download_model.sh`. It's tested in OS X, and it should
work on UNIX-based systems that have curl and unzip. I'm not
sure about Windows there.

As a last-ditch option, you could go to:

  https://www.dropbox.com/s/1q7cwmewooi18s0/model.zip?dl=0

Unzip the files yourself, and put them in src/main/resources.
This will serve as a launching point for actually performing the
inference operation.

Trained Model Source:
  https://github.com/KranthiGV/Pretrained-Show-and-Tell-model
This commit writes some boilerplate Java to load the model.

This will serve as a launching point for actually performing the
inference operation.
It works! Kind of. I'm using both Java and Python here via an "exec"
command, which is awful. However, my Java beam search isn't working, and
we need *something* immediately. This will get us a grade.


Former-commit-id: 1088b813da2558a7d58dd0a5da7c47b789f92b74 [formerly de31829a403b7b63932a3c13aa008d014cf624d4] [formerly 34a4ccf5f102bca70a908d7fc0a8b2eafa8c2b42 [formerly 44772b9b31c60eceeee723e93dd6be66903f6074]]
Former-commit-id: b16f580f57e677857bf545fec74fe39fa3158962 [formerly 08019804f54a7a1ef690675fbb49ff694989f198]
Former-commit-id: f73bc9c0ee1f2b2fae1c360aef307d07ff8ff650
This is for the Java implementation—no need to have it here.


Former-commit-id: c58fb555fb808459f7fdcd321a2baecf6b7f82c9 [formerly 14b8ba298613dc50752442b8d7712f0b236f399f] [formerly 127204b2a293add33b212a9d58adfad1a54fadf4 [formerly db1e0da74977da02357d23c2496d5307703594f0]]
Former-commit-id: 8ec547d403504ceb8c888679559c0d31bf9e5f80 [formerly b25e70df580ce5cf3dc718af913801ae943651d1]
Former-commit-id: 8e94c2eb33c48f18505df1961c2806b3d5e3cd38
Apparently it's still too big to push to GitHub!


Former-commit-id: 3a93ed20f3226a4e34d5003b6b79ad6b9e77738e [formerly 61385684b16bfebc147cafe8be545b7a7267de0d] [formerly 73c2a82e9d5fe333db4d7cc07c3f1f8a17f046b2 [formerly e4253171c51c73dbadcf64982b6c9dbcecff9e50]]
Former-commit-id: 427e3385b83787b541b8ba4c69269061ee5a931b [formerly e4d42c9aa5935073d15ae8762e8ad67fd3be1ae2]
Former-commit-id: b56ab545c2b19fa07a565c349ecab19a8f069c90
Now we can see if it changes


Former-commit-id: 2a8c38b9a794e7e6d3c73c429b8ae03bd7678ce3 [formerly b62ff160fae1ab0e5863a4b0a6e6bd663c1b35c4] [formerly 1d2dcd6db8d70c0121225ea8bf359f1cc305378b [formerly 2adc8ea0824636796685f7eb9ff5250fa05dffbf]]
Former-commit-id: 34da8b50ae16ac4bb03dc10e77fc037877067ec8 [formerly 7d863f5742ff2d7d94dfebf8d2ac720b17d4bf41]
Former-commit-id: f2f27d7b8f70d6d0ed46bcaddb491e115fc48ebd
@leesharma
Copy link
Owner Author

screenshot 2018-10-12 22 04 46

New GUI integrated!

Version 2 includes the GUI changes and basic tensorflow integration.
This commit bumps the pom.xml version and adds a new screenshot to the
README.
@leesharma leesharma changed the title [WIP] Ridiculous implementation of the Show and Tell model Ridiculous implementation of the Show and Tell model Oct 15, 2018
@leesharma leesharma changed the title Ridiculous implementation of the Show and Tell model [MERGE SECOND!] Ridiculous implementation of the Show and Tell model Oct 15, 2018
Copy link
Collaborator

@AdamKeller9 AdamKeller9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final cleanup! Thanks Lee!

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

Successfully merging this pull request may close these issues.

2 participants