-
Notifications
You must be signed in to change notification settings - Fork 313
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
Feature/Python3 & Windows10 compatibility #52
Conversation
…ature/Python3Window10
* using full import paths for deepmoji imports
importing global `VOCAB_PATH` instead of hardcoding string
* added requirement `requests`
Amazing, thank you for working on this! 🙌 |
@bfelbo are you comfortable with dropping Python2.7 support? Maybe locking the python2.7 version in another branch or tag? Otherwise, I could look into making this cross-compatible with python2.7 and python3+, but, in my experience this leads to messy code. |
* loading pickles with utf-8 encoding * writing csv in `w` mode instead of `wb` mode
* encountering pickle load error: `_pickle.UnpicklingError: the STRING opcode argument must be quoted`
Completely agree. Let’s drop 2.7 and make a new tag/release. Similarly, I’ve been thinking of upgrading the code to TF2 and dropping support for TF1. It requires converting the pretrained model to TF2, but that hopefully shouldn’t be too hard. |
Feel free to add a line to the README that you added Python3 support :) |
@bfelbo For verifying |
Besides some refactoring, this PR should be ready for review. However the following scripts could not be verified to work by me |
* not ignoring base `raw.pickle` files
Thank you Nathan. I'll take a look on the weekend :) |
Looking at it now. There's a lot of changes so it might take some time. |
Thanks for this PR. It's clear that you've put a lot of effort into this. I've been trying to review this, but it's hard as there's a lot of other changes to the code besides adding Python3 / Windows compatibility. A few examples:
Some of these changes might be useful, but it'd be great if they could be submitted as separate pull requests after moving the codebase to Python3. The smaller the pull request, the easier it is to review/merge it :) Can you update this PR (or create a new one) to contain only the minimal changes needed for Python3 support? That'd be amazing. |
If I try to run |
I'll minify this PR to is base elements! Thanks for your initial reviews! |
was opening writing as bytes when content to be written was `str`
Have you installed the deepmoji project locally? Running the following command: pip install . Within the project directory should install deepmoji to your python environment. Afterwards, you should be able to import Within my installed deepmoji environment I'm able to run |
PR continued on with #53 closing this bloated PR |
Migrating code to work for Python3. This drops Python2 support.
Adding support to execute within a windows environment.
Fixing path specifications to have better support on windows.
Tested with a
tensorflow==2.0.0
backend on a windows 10 machine.Features:
scripts/download_weights.py
is now system agnostic by using requests.travis.yml
build now tests on windows 10, osx, and linuxTODO:
keras
andtensorflow
might have changed behavior with using the prebuiltdeepmoji_weights.hdf5
modeltest_finetuning.test_encode_texts
is raising aAssertionError
as itsavg_across_sentances
is[-0.024 0.027 -0.046 -0.002 -0. ]
instead of test's expected[-0.023, 0.021, -0.037, -0.001, -0.005]
examples
has not been heavily tested or validated on windows 10scripts/analyze_all_results.py
scripts/analyze_results.py