Run Keras models remotely on TPU seamlessly.
Project description
Keras Remote
Run Keras models remotely on TPU as seamlessly as running the same code locally.
Prerequisites
- Google Cloud SDK: Install the
gcloudCLI. - Authentication: Run
gcloud auth loginandgcloud auth application-default login. - Permissions: Ensure your GCP user has permissions to create and manage TPU VMs.
Installation
pip install -r requirements.txt
Running the Demo
The demo_train.py script demonstrates how to run a Keras model on a remote TPU.
# Optional: Set your GCP project and zone
export KERAS_REMOTE_PROJECT="your-project-id"
export KERAS_REMOTE_ZONE="us-central1-f" # or other zones like europe-west4-a
python demo_train.py
Note: TPU availability varies by zone. If you encounter a RESOURCE_EXHAUSTED error, try a different zone or accelerator type (e.g., v2-8 vs v3-8).
The @keras_remote.run decorator handles:
- Packaging your local code.
- Provisioning (or finding) a TPU VM.
- Uploading your code and dependencies.
- Executing the function inside a Docker container on the TPU VM.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file keras_remote-0.0.1.tar.gz.
File metadata
- Download URL: keras_remote-0.0.1.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44d3d546043a7899ff133c2150caa28fdae18de3750ddabdb5a5cf6f450ef182
|
|
| MD5 |
a13b7ee74b7a0da516b1b106e6c9af81
|
|
| BLAKE2b-256 |
55d76142555dc355410a8a9027bc5d0af70d058accab6d0d11a4ee286963bbff
|
File details
Details for the file keras_remote-0.0.1-py3-none-any.whl.
File metadata
- Download URL: keras_remote-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62bb3237d82bdee6af58be00aada3be3e6c0d397a698daaa8706a2c7597bac53
|
|
| MD5 |
7880c44d8230aae59cb18ceaa58499fb
|
|
| BLAKE2b-256 |
73b6c2a216d67b37ffd5645715b750fe34d2ccca747d8ba87fe6c1d2a17ffd3b
|