EasyTensor
The official python client for EasyTensor.
Installation
Pretty straightforward.
pip install easytensor
Usage
Once you have a model exported to your local storage, you can upload it to easytensor in one line of code.
TensorFlow
Exporting and uploading a model
import easytensor
import os
export_path = os.path.join(os.getcwd(), "my_model")
print("export_path: {}".format(export_path))
# Export the model
tf.keras.models.save_model(
model,
export_path,
overwrite=True,
include_optimizer=True,
save_format=None,
signatures=None,
options=None
)
# Upload it to easytensor.
model_id, access_token = easytensor.tensorflow.upload_model("My first model", export_path)
print("model ID:", model_id)
print("access token:", access_token)
Running prediction on the cloud
from pprint import pprint
import requests
response = requests.post(
"https://app.easytensor.com/query/",
json={
"instances": [
image_to_predict.numpy().tolist()
]
},
headers={"accessToken": access_token}
)
print("Response from server:")
pprint(response.json())
Examples
The library comes with a few example Jupyter notebooks that walk you through a few possible workflows. They are helpful if you are starting out with ML or remote model prediction.
Requirements
- Tensorflow 2. TF2 currently (early 2021) requires a python version 3.5-3.8. You will have to install a compatible version of python.
- virtualenv
- jupyter notebook
For Mac
brew install python@3.8
For Ubuntu
sudo apt install python3.8 python3.8-dev
To run the examples, create a python virtual env, and install jupyter notebook.
# install virtualenv
pip3 install virtualenv
# create a virtualenv with python3.8 in ~/virtualenv-3.8
virtualenv --python=$(which python3.8) ~/virtualenv-3.8
# activate the virtual env
source ~/virtualenv-3.8/bin/activate
# install jupyter notebook and necessary widgets
pip install notebook ipywidgets
# run jupyter notebook
jupyter notebook
Questions and Help
If you have any querstions about how EasyTensor works or want help with serving your ML model, please contact me directly at kamal@easytensor.com. I'm here to help!
Metadata
Release files for easytensor 0.0.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| easytensor-0.0.10.tar.gz | 10.6 kB | Without provenance | Details for easytensor-0.0.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| easytensor-0.0.10-py3-none-any.whl | Python 3 | none | any | Details for easytensor-0.0.10-py3-none-any.whl |
Total release size: 24.1 kB
Release files / easytensor-0.0.10.tar.gz
| Download URL | easytensor-0.0.10.tar.gz |
|---|---|
| Size | 10.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2117f670ba5d5c8672d2b3cfc8330e08c97515c379f86fdef71b5aebc2280603
|
|
BLAKE2b-256 checksum How to use checksums |
f03697430aabd74679e094a011cfa4f4db7fb5454038aaa3200cae171d0d1c04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8
|
Release files / easytensor-0.0.10-py3-none-any.whl
| Download URL | easytensor-0.0.10-py3-none-any.whl |
|---|---|
| Size | 13.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3e25735d560130e0ef77950c7f26b113cbe8cadceb75846c3bda19806a801844
|
|
BLAKE2b-256 checksum How to use checksums |
2255d440510efcd8ed9c19d10350e8512c4d8ed7485b293bf6bb239fdbb85ebe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8
|
Security for easytensor 0.0.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.