TensorFlow is hard against PyTorch, is it finally defeated?

[CSDN Editor’s Note] Where there is competition, there are rivers and lakes. In recent years, in terms of machine learning frameworks, the competition between TensorFlow and PyTorch has attracted everyone’s attention. After several iterations, who is the better framework? reference value.

Original link: https://ift.tt/K15fESu

Disclaimer: This article is translated by CSDN, without permission, it is forbidden to reprint.

Author | Ari Joury

Translator | Crescent Moon Editor | Tu Min

Produced | CSDN (ID: CSDNnews)

In the tech industry, there are endless debates at all levels, some about different operating systems, while others are about the pros and cons of cloud providers or deep learning frameworks. At gatherings, big and small, after a few glasses of wine, people will fight for their respective technologies and embrace the “Holy Grail” in their hearts.

For example, the IDE debate has never stopped, some people like Visual Studio, some people choose to use IntelliJ, and some people like to use old-fashioned editors, such as Vim.

A similar war broke out between PyTorch and TensorFlow. Both camps have legions of supporters, and both have good arguments for why their chosen framework is the best.

Having said that, statistics show that, as of now, TensorFlow is the most widely used deep learning framework. Every month there are almost twice as many questions on StackOverflow about TensorFlow as there are about PyTorch.

TensorFlow, on the other hand, has pretty much stagnated since around 2018, while PyTorch has been on a steady rise.

In addition to comparing PyTorch and TensorFlow, the figure below also includes Keras, because it was released almost at the same time as TensorFlow. But, as you can see, Keras has struggled in recent years. Simply put, Keras is too simplistic and too slow for the needs of most deep learning practitioners.

Figure: PyTorch is still developing, while TensorFlow has stagnated.

In the short term, the popularity of TensorFlow on StackOverflow will not decline rapidly, but it is still showing a downward trend. We have reason to believe that this downward trend will become more pronounced in the coming years, especially in the world of Python.

PyTorch is more Pythonic

Developed by Google and launched in late 2015, TensorFlow was one of the first deep learning frameworks. However, the first version of TensorFlow was rather cumbersome to use—of course, the first version of most software tends to be the case.

This is why Meta developed PyTorch to provide the same functionality as TensorFlow, but easier to use.

The developers behind TensorFlow were quick to take notice and introduced many of PyTorch’s most popular features in TensorFlow 2.0.

It’s often said that anything PyTorch can do, TensorFlow can do, but you’ll have to spend twice as much code writing it. Even today, the use of TensorFlow still has a threshold and does not conform to the style of Python.

On the contrary, if you like Python, then using PyTorch will feel very natural.

PyTorch has more models available

Many companies and academic institutions do not have the massive computing power needed to build large models. However, when it comes to machine learning, scale is king. The larger the model, the better the performance.

HuggingFace provides a large number of trained and tuned large-scale models that engineers can use to integrate them into their own pipelines with just a few lines of code. However, 85% of these models can only be used in PyTorch, only about 8% of the HuggingFace models are unique to TensorFlow, and the rest of the models can be used in both frameworks.

This means that if you plan to use large models, you’d better stay away from TensorFlow, or invest a lot of computing resources to train your own models.

PyTorch is better for students and research

PyTorch is well-received in academia. Not without reason, three out of four research papers use PyTorch. Even researchers who chose to use TensorFlow in the beginning, most have now migrated to PyTorch.

Even though Google has a sizable market share in AI research and primarily uses TensorFlow, the above trends are striking and here to stay.

It is even more important to note that research influences teaching and therefore can determine what students learn. Most professors who use PyTorch to publish papers will prefer to use it to teach courses. Not only are they more willing to teach and answer questions about PyTorch, but they are more confident in the success of the framework.

Therefore, college students probably know more about PyTorch than TensorFlow. Plus, today’s college students are tomorrow’s software developers, so it’s clear where this trend is headed…

PyTorch’s ecosystem grows faster

Ultimately, software frameworks only attract attention when they become a force to be reckoned with in the corresponding ecosystem. Both PyTorch and TensorFlow have very developed ecosystems. In addition to HuggingFace, there are other training model libraries, data management systems, and failure prevention mechanisms.

It is worth mentioning that, as of now, TensorFlow’s ecosystem is more complete than PyTorch. But keep in mind that PyTorch is a relatively newcomer and has seen very rapid user growth over the past few years. Therefore, it is expected that PyTorch’s ecosystem may surpass TensorFlow in the future.

TensorFlow has better deployment infrastructure

Although writing code in TensorFlow is pretty crappy, once written, it’s far less difficult to deploy than PyTorch. With tools like TensorFlow Serving and TensorFlow Lite, we can quickly deploy code to clouds, servers, mobile devices, and IoT devices.

On the other hand, PyTorch’s release deployment tool is very slow. Having said that, the gap between it and TensorFlow has been rapidly closing recently.

Although it is difficult to say for sure, we believe that in the next few years, PyTorch’s deployment infrastructure may catch up with or even surpass TensorFlow.

In the short term, the popularity of TensorFlow will not disappear because of the high cost of switching frameworks after deployment. However, it is conceivable that more and more deep learning applications will be written and deployed in PyTorch in the future.

The programming language supported by TensorFlow is not limited to Python

TensorFlow isn’t dead, it’s just not as popular as it once was.

The core reason is that many people who use Python to develop machine learning projects are moving to PyTorch.

But Python isn’t the only machine learning language out there. It’s just that Python is used in many development machine learning projects, which is the only reason why the developers of TensorFlow made an effort to support Python.

Today, one can use TensorFlow with JavaScript, Java, and C++, among others. The community has also started developing support for other languages ​​such as Julia, Rust, Scala, and Haskell.

On the other hand, everything about PyTorch is Python-centric, which is why the framework is very Pythonic. While PyTorch has a C++ API, support for other languages ​​is less than half that of TensorFlow.

In terms of Python alone, PyTorch is definitely more dominant, but on the other hand, TensorFlow has a strong ecosystem and deployment capabilities, and supports many other languages, so it will remain a force that cannot be ignored in the field of deep learning.

Overall, whether you choose TensorFlow or PyTorch for your next project will mostly depend on how much you like Python.

“2022-2023 Chinese Developer Survey” is launched, welcome to scan the QR code below to participate in the survey, and there are exquisite gifts such as iPads waiting for you!


☞Xiaomi car design drawings leaked, the official said it was not the final document; Microsoft’s layoffs and severance payments reached 800 million US dollars, and the per capita compensation was 540,000 yuan; Apple suspended self-developed Wi-Fi chips|Geek Headlines

☞The ex-employee “betrayed” and leaked 44.7 GB of the source code of the old club!

☞Microsoft is building a new Edge “Phoenix” browser? Netizen: Superfluous?

The text and pictures in this article are from CSDN

loading.gif

This article is transferred from https://www.techug.com/post/tensorflow-is-hard-to-beat-pytorch-is-it-the-end-of-the-battlea715de84bab6ba5d599f/
This site is only for collection, and the copyright belongs to the original author.