[Service Development Team, Hyun-Jun Han]
Tensorflow and PyTorch are the most popular libraries for machine learning. Developers who develop AI services or researchers who study models often face difficulties in selecting a library at the beginning. Also, there are a lot of changes as the library version goes up, so we want to provide a guide in choosing a library.
Google – Tensorflow
Facebook – PyTorch
PyTorch is a library developed by Facebook AI Research Lab for research purposes. Compatible languages include C++ and Python. In the beginning, the community was relatively small, but it has grown explosively and has overtaken Tensorflow in conference papers. The reason why users in many research fields have moved to PyTorch is that it can use dynamic graphs. This is because it was advantageous for RNN, CNN, and GAN research because it was possible to compare data by replacing data in real time through dynamic graphs. Also, I think the code has grown significantly as the difficulty is relatively easy compared to Tensorflow.
Tensorflow VS PyTorch
This is a graph of papers for each conference in the field of artificial intelligence. It can be seen that the trend of PyTorch's papers expressed as solid lines is higher than Tensorflow expressed with dotted lines. I think PyTorch is a bit more advantageous when it comes to researching conference papers.
Tensorboard [1.2 Pytorch]
|Graph Definition||static graph,|
Dynamic graph [tensorflow 2.0]
|debugging||tfdbg||Python standard debuggers|
|model deployment||Tensorflow Serving||TorchServe|
When comparing each library functionally, it seems that they tend to be more and more identical as the versions go up. There were many differences between the two libraries at first, but over time the differences have diminished significantly as they have had good features from each other.
Nevertheless, the limitations of both libraries still exist. Tensorflow is still relatively difficult to construct dynamic graphs, and debugging also requires training. PyTorch has few open sources yet, it is difficult to support other environments, it is difficult to deploy, and above all, it is difficult to meet the various constraints required by the industry. Referring to these points, it will be helpful in selecting a library if you proceed with the project after clearly understanding whether the focus is for research purposes or to provide products and services.
Tensorflow – for product building purposes. Browser, Node.js, Embeded, Mobile environment support. Easy to deploy. NLP, etc.
Pytorch – for research purposes. An environment familiar with Python. Relatively low difficulty. RNNs, CNNs, GANs, etc.
Both Tensorflow and Pytorch are powerful ML libraries. If you select a library according to your purpose, I think more productive research/development will be made.