Registry / ai-ml / tensorflow-cpu-aws

tensorflow-cpu-aws

JSON →
library2.15.1pypypiunverified

TensorFlow is an open-source machine learning framework. The `tensorflow-cpu-aws` package is a distribution of TensorFlow specifically optimized for CPU (ARM64/Aarch64) architectures, built and maintained by AWS. It is typically installed automatically as a dependency when the generic `tensorflow` package is installed on an ARM-based system. The current version is 2.15.1, and its release cadence generally aligns with the main TensorFlow releases.

pip install tensorflow-cpu-aws
INSTALL
IMPORT
SIG · TENSORFLOW-CPU-AWS
T
tensorflow-cpu-aws
ai-mlpythonv2.15.1
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
4/8 runs
py 3.11
✕ build_error
4/8 runs
py 3.12
✕ build_error
4/8 runs
py 3.13
✕ build_error
4/8 runs
py 3.9
✕ build_error
4/8 runs
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

tensorflow
import tensorflow as tf
keras
from tensorflow import keras

This quickstart demonstrates how to import TensorFlow, verify its version and device availability (which should show only CPU devices for this package), and perform a basic tensor operation. It also includes a simple Keras model definition and a forward pass, illustrating typical usage for a CPU-only environment.

import tensorflow as tf # Verify TensorFlow installation and basic operation print("TensorFlow version:", tf.__version__) print("Is GPU available:", tf.config.list_physical_devices('GPU')) # Create a simple constant tensor hello = tf.constant('Hello from TensorFlow-CPU-AWS!') print(hello.numpy().decode('utf-8')) # Perform a basic operation a = tf.constant(10) b = tf.constant(32) print("a + b =", tf.add(a, b).numpy()) # Example with Keras (MNIST dataset) mnist = tf.keras.datasets.mnist (x_train, y_train), (x_test, y_test) = mnist.load_data() x_train, x_test = x_train / 255.0, x_test / 255.0 model = tf.keras.models.Sequential([ tf.keras.layers.Flatten(input_shape=(28, 28)), tf.keras.layers.Dense(128, activation='relu'), tf.keras.layers.Dropout(0.2), tf.keras.layers.Dense(10) ]) predictions = model(x_train[:1]).numpy() print("Sample predictions shape:", predictions.shape)
Debug
Known issues
breakingFor TensorFlow versions 2.16 and later, the `tensorflow` package's metadata has sometimes incorrectly specified a tight dependency on a `tensorflow-cpu-aws` version (e.g., `tensorflow-cpu-aws==2.16.1`) that might not yet be released. This can lead to dependency resolution failures during installation on ARM64/Aarch64 machines.
fix
Check PyPI for the exact `tensorflow-cpu-aws` version available. If there's a mismatch, you might need to pin the `tensorflow` version to one compatible with the latest `tensorflow-cpu-aws` release or wait for an updated `tensorflow-cpu-aws` package.
affects: >=2.16.0
gotchaThe `tensorflow-cpu-aws` package is specifically compiled for ARM64/Aarch64 processors. Attempting to install this package directly on an x86_64 architecture will result in a 'No matching distribution found' error, as compatible wheels are not available for that platform.
fix
If on an x86_64 machine, install `tensorflow` or `tensorflow-cpu` (often resolved to `tensorflow-intel` on Windows/Intel Linux) instead. On ARM64/Aarch64, `pip install tensorflow` will typically pull in `tensorflow-cpu-aws` automatically.
affects: All versions
gotchaRunning TensorFlow on under-provisioned AWS EC2 instances (e.g., free-tier `t2.micro`) can lead to `ResourceExhaustedError: OOM when allocating tensor` or the `pip install` process being 'killed' due to insufficient RAM or CPU.
fix
Upgrade to an EC2 instance type with more memory and CPU (e.g., `c5` or `m5` families for CPU-intensive tasks). Ensure sufficient disk space as well. When installing, `pip install tensorflow-cpu --no-cache-dir` might help if cache-related disk space is an issue.
affects: All versions
gotchaTensorFlow may not fully utilize all available CPU cores on multi-core instances by default, potentially leading to lower-than-expected performance.
fix
Explicitly configure TensorFlow's inter-op and intra-op parallelism threads using `tf.config.threading.set_inter_op_parallelism_threads()` and `tf.config.threading.set_intra_op_parallelism_threads()` to match your instance's core count.
affects: All versions
Upgrade
Version history
2.15.1latest on PyPI · released Mar 14, 2024
Audit
Dependencies
tensorflowrequiredThis package is a specific build of TensorFlow for ARM64/Aarch64 CPUs and is often a dependency resolved when 'tensorflow' is installed on compatible systems.
Agent activity
13 hits · last 30 days
node
11
OpenAI (training)
1
Resources