Skip to main content

The official python cient of EasyTensor

Project description

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

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!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easytensor-0.0.7.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

easytensor-0.0.7-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file easytensor-0.0.7.tar.gz.

File metadata

  • Download URL: easytensor-0.0.7.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for easytensor-0.0.7.tar.gz
Algorithm Hash digest
SHA256 4fda41a82f444bdd949d567a184ba907cdba6e7622cede531b35fc62254e289f
MD5 e0614a824d7d064c5eb3be8d881347c7
BLAKE2b-256 a7533b7ccda052acf7da7ed4d46d2a1c1e1fb8d8efe52bb086c4181110b03fb7

See more details on using hashes here.

File details

Details for the file easytensor-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: easytensor-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for easytensor-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 76d8b3c9c83df86bed6fa7a46bb99e2180b1bafe8de9def127c25a9c5b8a7035
MD5 b74370e5d2ff2abc2b0ca0e8e6d464ce
BLAKE2b-256 e401f25f3ab032416d1b37e54c20af887efba5075dd232c188ad16c9097a5c02

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page