Skip to content
This repository has been archived by the owner on Nov 18, 2023. It is now read-only.

Commit

Permalink
Build corrections (#45)
Browse files Browse the repository at this point in the history
- Corrects applicable Python versions for PyPi deployment
- Corrects installation instructions, and makes the `animaltrade` example requirements reference the general KGCN requirements
- Fixes the broken link to the `animaltrade` example in the KGCN README
- Prints warnings at runtime to warn the user that the TensorFlow Hub module used may take some time to download, so that they know the process hasn't hung

Addresses #37 #38
  • Loading branch information
jmsfltchr authored Feb 5, 2019
1 parent 43daa3c commit 995772f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
- run: sudo apt-get update
- run: pyenv install 3.6.3
- run: pyenv global 3.6.3
- run: bazel run //:deploy-pip -- test $PYPI_TEST_SERVER_USERNAME $PYPI_TEST_SERVER_PASSWORD
- run: bazel run //:deploy-pip -- pypi $PYPI_USERNAME $PYPI_PASSWORD

workflows:
version: 2
Expand Down
4 changes: 1 addition & 3 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ deploy_pip(
package_name = "grakn-kglib",
version_file = "//:VERSION",
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
Expand Down
3 changes: 1 addition & 2 deletions examples/kgcn/animal_trade/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

**Requirements:**

- Python 3.6.3 < version < 3.7 ([tensorflow doesn't yet support Python 3.7](https://github.com/tensorflow/tensorflow/issues/17022))
- kglib installed from pip: `pip install grakn-kglib`
- The requirements listed in the [KGCN quickstart](https://github.com/graknlabs/kglib/tree/master/kglib/kgcn#quickstart)
- The source code in order to access the example `git clone https://github.com/graknlabs/kglib.git`
- The `grakn-animaltrade.zip` dataset from the [latest release](https://github.com/graknlabs/kglib/releases/latest). This is a dataset that has been pre-loaded into Grakn v1.5 (so you don't have to run the data import yourself), with two keyspaces: `animaltrade_train` and `animaltrade_test`

Expand Down
6 changes: 3 additions & 3 deletions kglib/kgcn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ This project introduces a novel model: the *Knowledge Graph Convolutional Networ

**Requirements:**

- Python 3.6.3 < version < 3.7 ([tensorflow doesn't yet support Python 3.7](https://github.com/tensorflow/tensorflow/issues/17022))
- Python 3.6.3 <= version < 3.7 ([tensorflow doesn't yet support Python 3.7](https://github.com/tensorflow/tensorflow/issues/17022))

- kglib installed from pip: `pip install --extra-index-url https://test.pypi.org/simple/ grakn-kglib`
- kglib installed from pip: `pip install grakn-kglib`. Ensure that `pip` use the Python version listed above. Find out using 'pip --version'. By default `pip` may use Python 2, in which case you may need either `pip3`, or to create an isolated environment using `pipenv`/`virtualenv`, or change your global Python with `pyenv`.

### Usage

Expand Down Expand Up @@ -47,7 +47,7 @@ transaction.close()
session.close()
```

There is also a [full example](https://github.com/graknlabs/kglib/examples/kgcn/animal_trade) which outlines retrieving sample concepts with labels and working with separate keyspaces for training and testing.
There is also a [full example](https://github.com/graknlabs/kglib/tree/master/examples/kgcn/animal_trade) which outlines retrieving sample concepts with labels and working with separate keyspaces for training and testing.

## Methodology

Expand Down
4 changes: 4 additions & 0 deletions kglib/kgcn/encoder/tf_hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
class TensorFlowHubEncoder:

def __init__(self, module_url, output_feature_length, name='tf_hub_encoder'):
print(f'Initialising TensorFlow Hub Encoder op\n'
f'This may take a long time on its first run, as a pre-trained network module ({module_url}) needs to be '
f'downloaded...')
self._embed = hub.Module(module_url)
print('...Encoder op initialised')
self._name = name
self._output_feature_length = output_feature_length

Expand Down

0 comments on commit 995772f

Please sign in to comment.