The Battle: TensorFlow vs. Pytorch
The Battle: TensorFlow vs. Pytorch
Which machine learning framework should you use? An answer from 3,000 developers.
Join the DZone community and get the full member experience.Join For Free
Who hasn’t heard about the battle between Facebook’s PyTorch and Google’s TensorFlow? A quick search will reveal the intensity of this clash of frameworks. Here is one great article by Kirill Dubovikov.
At its core, the duel is fuelled by the similarity of the two frameworks. Both frameworks:
- Are open source libraries for high-performance numerical computation
- Are supported by large tech companies
- Have strong and active supporting communities
- Are Python-based
- Use graphs to represent the flow of data and operations
- Are well documented
Taking all of this into account, we can say that almost anything created in one of the frameworks can be replicated in the other at a similar cost. Therefore, the question stands.
Which framework should you use? What is the main difference between each community?
At /Data, we are constantly surveying the developer community to track the trends and predict the future of different technology sectors. For machine learning, in particular, this clash is critical. The prevailing framework, if there is one, will have a huge impact on the path that the machine learning community will take in the years to come.
With this in mind, we asked the developers who said that they are involved in data science (DS) or machine learning (ML) which of the two frameworks they are using, how they are using them, and what else they do in their professional life.
TensorFlow is winning the game, but is PyTorch playing on the same console?
From the 3,000 developers involved in ML or DS, we saw that 43 percent of them use PyTorch or TensorFlow.
This 43 percent is not equally distributed between the two frameworks. TensorFlow is 3.4 times bigger than PyTorch. A total of 86 percent of ML developers and data scientists said they are currently using TensorFlow, while only 11 percent were using PyTorch.
Moreover, PyTorch has more than 50 percent of its community also using TensorFlow. On the other hand, only 15 percent of the TensorFlow community also uses PyTorch. It would seem like TensorFlow is a must, but PyTorch is a nice-to-have.
Who is using PyTorch and who is using TensorFlow? What is each framework being used for the most?
Here are the things that really stood out from the rest:
It is conclusive. In comparison to PyTorch, TensorFlow is being used in production and most probably deployed to the cloud as implied by the significantly higher backend experience of TensorFlow users (4.8 years vs. 3.8 of PyTorch users). As compared to PyTorch, its community is composed more of professional machine learning developers (28 percent), software architects (26 percent), and programmers within a company (58 percent). This is most likely due to Google’s focus on deployment through APIs such as Tensorflow serving, which has become a key motivator for the adoption of TensorFlow for many developers who are trying to push data products into production environments.
On the other hand, PyTorch is being used more than TensorFlow for data analysis and ad-hoc models within a business context (10 percent). In the PyTorch community, there are far more Python-first developers (i.e developers using Python as a primary language) who work on web applications (46 percent). Moreover, the versatility of this Pythonic framework allows researchers to test out ideas with almost zero friction and therefore, it’s the go-to framework for the most advanced cutting edge solutions.
Interested in more insights about Machine Learning Developers and Data Scientists? Get in touch!
Opinions expressed by DZone contributors are their own.