The official TensorFlow docker image.
Maintained by: openEuler CloudNative SIG.
Where to get help: openEuler CloudNative SIG, openEuler.
Current TensorFlow docker images are built on the openEuler. This repository is free to use and exempted from per-user rate limits.
TensorFlow is an end-to-end open source platform for machine learning. It has a comprehensive, flexible ecosystem of tools, libraries, and community resources that lets researchers push the state-of-the-art in ML and developers easily build and deploy ML-powered applications.
Read more on TensorFlow Website.
The tag of each tensorflow docker image is consist of the version of tensorflow and the version of basic image. The details are as follows
| Tag | Currently | Architectures |
|---|---|---|
| 2.19.0-oe2403sp1 | TensorFlow 2.19.0 on openEuler 24.03-LTS-SP1 | amd64, arm64 |
| 2.20.0-oe2403sp1 | TensorFlow 2.20.0 on openEuler 24.03-LTS-SP1 | amd64, arm64 |
| 2.20.0-oe2403sp4 | TensorFlow 2.20.0 on openEuler 24.03-LTS-SP4 | amd64, arm64 |
In this usage, users can select the corresponding {Tag} based on their requirements.
Pull the openeuler/tensorflow image from docker
docker pull openeuler/tensorflow:{Tag}
Run with an interactive shell
You can also start the container with an interactive shell to use tensorflow.
docker run -it --rm openeuler/tensorflow:{Tag} bash
Introduction to Tensorflow with MNIST Example
Create a python file named mnist_example.py with the following content:
import tensorflow as tf
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, activation='softmax')
])
model.compile(optimizer='adam',
loss='sparse_categorical_crossentropy',
metrics=['accuracy'])
model.fit(x_train, y_train, epochs=5)
model.evaluate(x_test, y_test)
Run the file in your terminal:
python3 mnist_example.py
Expected output(actual numbers may vary slightly):
Epoch 1/5
1875/1875 ━━━━━━━━━━━━━━━━━━━━ 6s 3ms/step - accuracy: 0.8580 - loss: 0.4847
Epoch 2/5
1875/1875 ━━━━━━━━━━━━━━━━━━━━ 5s 3ms/step - accuracy: 0.9551 - loss: 0.1513
Epoch 3/5
1875/1875 ━━━━━━━━━━━━━━━━━━━━ 5s 3ms/step - accuracy: 0.9685 - loss: 0.1068
Epoch 4/5
1875/1875 ━━━━━━━━━━━━━━━━━━━━ 5s 3ms/step - accuracy: 0.9727 - loss: 0.0872
Epoch 5/5
1875/1875 ━━━━━━━━━━━━━━━━━━━━ 5s 3ms/step - accuracy: 0.9773 - loss: 0.0716
313/313 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - accuracy: 0.9718 - loss: 0.0870
If you have any questions or want to use some special features, please submit an issue or a pull request on openeuler-docker-images.
Content type
Image
Digest
sha256:7d483de66…
Size
115.1 MB
Last updated
about 1 year ago
docker pull openeuler/tensorflowPulls:
17
Last week