• Latest
  • Trending
Stream Data Processing with Apache Kafka and TensorFlow

Stream Data Processing with Apache Kafka and TensorFlow

December 16, 2021
Absa and Visa Extend Strategic Partnership to Advance Growth and Innovation Across Africa

Absa and Visa Extend Strategic Partnership to Advance Growth and Innovation Across Africa

July 29, 2025
French Telco Orange Hit by Cyber-Attack

French Telco Orange Hit by Cyber-Attack

July 29, 2025
ATC Ghana supports Girls-In-ICT Program

ATC Ghana supports Girls-In-ICT Program

April 25, 2023
Vice President Dr. Bawumia inaugurates  ICT Hub

Vice President Dr. Bawumia inaugurates ICT Hub

April 2, 2023
Co-Creation Hub’s edtech accelerator puts $15M towards African startups

Co-Creation Hub’s edtech accelerator puts $15M towards African startups

February 20, 2023
Data Leak Hits Thousands of NHS Workers

Data Leak Hits Thousands of NHS Workers

February 20, 2023
EU Cybersecurity Agency Warns Against Chinese APTs

EU Cybersecurity Agency Warns Against Chinese APTs

February 20, 2023
How Your Storage System Will Still Be Viable in 5 Years’ Time?

How Your Storage System Will Still Be Viable in 5 Years’ Time?

February 20, 2023
The Broken Promises From Cybersecurity Vendors

Cloud Infrastructure Used By WIP26 For Espionage Attacks on Telcos

February 20, 2023
Instagram and Facebook to get paid-for verification

Instagram and Facebook to get paid-for verification

February 20, 2023
YouTube CEO Susan Wojcicki steps down after nine years

YouTube CEO Susan Wojcicki steps down after nine years

February 20, 2023
Inaugural AfCFTA Conference on Women and Youth in Trade

Inaugural AfCFTA Conference on Women and Youth in Trade

September 6, 2022
  • Consumer Watch
  • Kids Page
  • Directory
  • Events
  • Reviews
Thursday, 16 July, 2026
  • Login
itechnewsonline.com
  • Home
  • Tech
  • Africa Tech
  • InfoSEC
  • Data Science
  • Data Storage
  • Business
  • Opinion
Subscription
Advertise
No Result
View All Result
itechnewsonline.com
No Result
View All Result

Stream Data Processing with Apache Kafka and TensorFlow

by ITECHNEWS
December 16, 2021
in Data Science, Leading Stories
0 0
0
Stream Data Processing with Apache Kafka and TensorFlow

As one of the most popular deep learning frameworks, TensorFlow has been used widely adopted in production across a broad spectrum of industries. The upcoming TensorFlow 2.0, which was announced recently, will be released early this year with many changes. The high-level tf.keras API, eager execution, and tf.data greatly simplify the usage. Here is a good example of model training in several lines:

“`

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(512, activation=tf.nn.relu),

 tf.keras.layers.Dropout(0.2),

 tf.keras.layers.Dense(10, activation=tf.nn.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)

 

“`

YOU MAY ALSO LIKE

French Telco Orange Hit by Cyber-Attack

ATC Ghana supports Girls-In-ICT Program

However, the data input processing component tf.data in TensorFlow only covers a small set of file formats. Users from different industries often encounter challenges integrating TensorFlow with data sources not commonly seen in the machine learning community.

One example is the integration of TensorFlow with Apache Kafka. Kafka is widely used for stream processing and is supported by most of the big data frameworks such as Spark and Flink. For a long time, though, there was no Kafka streaming support in TensorFlow. The data formats such as TFRecords and tf.Example in TensorFlow are also rarely seen in big data or data science community.

Many users are forced to consolidate these two frameworks in a very awkward way: setup another infrastructure, read messages from Kafka, convert the messages into TFRecord format, invoke TensorFlow to read the TFRecord from a file system, run the training or inference, and save the models or results back to the file system. This process is really error-prone and hard to maintain from an infrastructure perspective.

With help from the community, Apache Kafka streaming support for TensorFlow has been released recently as part of the tensorflow-io package (https://github.com/tensorflow/io) by TensorFlow’s SIG IO. SIG IO is a special interest group under TensorFlow organization, with a focus on I/O, streaming, and file formats support. In addition to Apache Kafka streaming, tensorflow-io also includes support for a very broad range of data formats and frameworks. It supports Apache Ignite for memory and caching, Apache Parquet and Arrow for serialization, AWS Kinesis and Google Cloud Pub/Sub for streaming, and many video, audio, and image file formats. Both Python and R language could be used, which are especially convenient to the data science community.

It is worth to mention that tensorflow-io is implemented as a part of the tf.data pipeline and natural extension of TensorFlow 2.0 API. In other words, users are able to read the data from Kafka and pass it to tf.keras. Training or inference is exactly the same simple and succinct way as the example shown at the beginning of this article.

By Yong Tang

ShareTweet

Get real time update about this post categories directly on your device, subscribe now.

Unsubscribe

Search

No Result
View All Result

Recent News

Absa and Visa Extend Strategic Partnership to Advance Growth and Innovation Across Africa

Absa and Visa Extend Strategic Partnership to Advance Growth and Innovation Across Africa

July 29, 2025
French Telco Orange Hit by Cyber-Attack

French Telco Orange Hit by Cyber-Attack

July 29, 2025
ATC Ghana supports Girls-In-ICT Program

ATC Ghana supports Girls-In-ICT Program

April 25, 2023

About What We Do

itechnewsonline.com

We bring you the best Premium Tech News.

Recent News With Image

Absa and Visa Extend Strategic Partnership to Advance Growth and Innovation Across Africa

Absa and Visa Extend Strategic Partnership to Advance Growth and Innovation Across Africa

July 29, 2025
French Telco Orange Hit by Cyber-Attack

French Telco Orange Hit by Cyber-Attack

July 29, 2025

Recent News

  • Absa and Visa Extend Strategic Partnership to Advance Growth and Innovation Across Africa July 29, 2025
  • French Telco Orange Hit by Cyber-Attack July 29, 2025
  • ATC Ghana supports Girls-In-ICT Program April 25, 2023
  • Vice President Dr. Bawumia inaugurates ICT Hub April 2, 2023
  • Home
  • InfoSec
  • Opinion
  • Africa Tech
  • Data Storage

© Copyright 2026, All Rights Reserved | iTechNewsOnline.Com - Powered by BackUPDataSystems

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In

Add New Playlist

No Result
View All Result
  • Home
  • Tech
  • Africa Tech
  • InfoSEC
  • Data Science
  • Data Storage
  • Business
  • Opinion

© Copyright 2026, All Rights Reserved | iTechNewsOnline.Com - Powered by BackUPDataSystems

Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?
Go to mobile version