( ** Deep Learning Training: https://www.edureka.co/ai-deep-learning-with-tensorflow ** )
This Edureka comparison PPT of "PyTorch vs TensorFlow" provides you with a detailed comparison between the top 2 Python Deep Learning Frameworks.
Follow us to never miss an update in the future.
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
3. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Deep Learning Frameworks
Dynamic
Computation
Graphs
Python Support
Support
for CUDA
Easy to Use API
Fast and Feels
Native
Actively used
Visualizer
Easily Trainable
Layered
Components
Open Source
Flexible
Google
5. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Comparison Factors
Deployment5
Documentation6
Device Management7
Custom Extensions8
Ramp-Up Time 1
Graph Creation 2
Coverage 3
Serialization 4
6. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Ramp-Up Time
PyTorch
GPU enabled drop-in replacement
for NumPy
NumPy functionality makes it easier
to learn
TensorFlow
TensorFlow code gets compiled into a graph
by Python.
TensorFlow Execution Engine is used.
PyTorch
PyTorch code is known for executing
faster and more efficiently
Not many extra concepts to learn.
TensorFlow
Extra concepts needed such as
Session, Variable Scoping and
Placeholders.
More Boilerplate code needed
1
3
2
4
7. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Graph Construction and Debugging
PyTorch PyTorch
TensorFlow TensorFlow
Dynamic Computation Graphs
Graphs can be built at runtime
Graph construction is static
Graphs need to be compiled first
Debugging PyTorch is same as Python code
pdb – Python Debugger can be used
Learn TensorFlow debugger(tfdbg) – Extra!
Request variables from session to inspect
8. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Coverage
Less features compared to TensorFlow
Not as popular as TensorFlow among
freelancers and learners.
TensorFlow Packages
‘contrib’ package for more models
Support for higher level functions
Flipping a tensor along a dimension
and checking a tensor for NaN and
infinity
Fast Fourier transforms supported
9. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Serialization
Entire graph is saved as a protocol buffer
This includes parameters and operations
PyTorch has a simple API
The API saves all weights of all
the models
GO WITH THE FLOW!
Graph can be loaded in other
supported languages such as
C++ and Java.
Support for running old models
as well.
10. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Deployment
1
2
3
4
Mobile Deployments
TensorFlow is better for Mobile deployments.
Easier understanding of data flow in the
framework
Android and iOS
No need to rewrite the entire inference
portion of the model in Java or C++
Availability of TensorBoard.
Small Scale Applications
For small scale server-side deployments
both frameworks are easy to wrap
For example, Flask web server.
High Performance
TensorFlow serving can be used for server-side
deployments.
Models can be swapped easily without bringing the
service down.
11. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Documentation
01 02 03
API Documentation
Python APIs are very
well documented
Lot of examples and
tutorials to learn
both PyTorch and
TensorFlow
Lot of learners and
support.
More results for
use-cases and
tutorials.
Production support
Win-Win Situation
Everything can be
found in terms of
documentation for
both frameworks.
However, PyTorch C
library requires a
little more
documentation.
{ api }
12. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Device Management
PREFERENCE
TensorFlow is preferred for it’s seamless integration for everyone ranging
from beginners to the advanced users.
ASSUMPTION
By default, TensorFlow assumes you want to run the code on the GPU if
one is available.
MANUAL INTERVENTION
With PyTorch, everything need to be moved onto the device even if CUDA
is enabled.
ONE DOWNSIDE OF TENSORFLOW
By default, TensorFlow consumes all memory on all available GPUs even if only
one is being used.
04
03
02
01
13. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Custom Extensions
Win-Win
Compiling the extension is straightforward
with both frameworks.
No need for downloading any headers or
source code (All included in pip)
Building Custom Extension
Binding custom extensions written in C, C++ or
CUDA is doable with both frameworks
Depends on personal preference and the
organization which implements the models
TensorFlow requires more boilerplate
code
Support for multiples devices and
types
First, we need to write an interface
Then write implementation for each CPU and
GPU versions
Losswise can be used as an alternative to
TensorBoard
15. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
50% 50%
Conclusion – Optimism
TensorFlow
TensorFlow is better for large-
scale deployments
Good for cross-platform and
embedded deployment
Bigger community base and
many users
PyTorch
PyTorch is better for rapid
prototyping in Research.
Good start for hobbyists and
small-scale projects
Better utilization and
optimization for use of GPUs
16. AI & Deep Learning Training www.edureka.co/ai-deep-learning-with-tensorflow
Conclusion – My Opinion
TensorFlow is better for large-
scale deployments
Good for cross-platform and
embedded deployment
Bigger community base and
many users
PyTorch
PyTorch is better for rapid
prototyping in Research.
Good start for hobbyists and
small-scale projects
Better utilization and
optimization for use of GPUs 65%
35%
TensorFlow