Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of PyTorch1.3 and TensorFlow 2.0

2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article shows you the sample analysis of PyTorch1.3 and TensorFlow 2.0. the content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

PyTorch 1.0 and above have added a lot of features below TensorFlow 2.0, while TensorFlow 2.0 and above have added more and more PyTorch features. This means that PyTorch will get more and more static computing graph tools, while TensorFlow allows the execution of eager mode.

Nevertheless, I think PyTorch is more researcher-friendly, more suitable for faster implementation of new methods, and improves compatibility with C++. The advantage of TensorFlow is still the integration of Google ecosystems (TFLite,Android 's TFLite,TPU, etc.). However, no matter which one I use, there are still a lot of problems, mainly related to Python.

Most people who engage in deep learning don't realize what's going on backstage. The easy-to-use Python API appears on the front end, while the back end is written in a completely different language (as is the case with many Python packages). Until now, the main packages for PyTorch and TensorFlow have not been written in Python:

As far as other software packages / extensions are concerned, for example, TensorFlow iUnip O (or PyTorch's data iUnip O transmission path), it is clear that C++ has built a complete ecosystem and has overcome many of the problems that have arisen in Python that cannot be solved on Python memory iThink O. Just to avoid unnecessary performance problems, basically, we must avoid using the Python (and NumPy) functions as much as possible and try to use the PyTorch and TensorFlow functions instead.

PyTorch claims that it is not the API for the C++ framework, however, once it is built and used with Cython and Numba, it is fine. If we use TensorFlow through a Julia API called TensorFlow.jl, then we no longer face any outstanding issues, because Julia's memory management is much better.

More generally, many of the slow phenomena in the deep learning model are caused by memory I / O. Whether we are doing object detection or key point annotation, and want to display in real time, these are almost all right. You only need to consider anything running on the video stream. It takes more effort (part of my day job) to overcome the in-memory Icando O problem than to speed up the deep learning model applied here.

So, where will the development of deep learning framework go? Automatic discrimination is still a huge problem, especially for really rare features. Use Swift for TensorFlow experiment, PyTorch? Who knows where they're going.

I'm not a big fan of C++ (I prefer C to C++) because it's error-prone and can lead to security issues. Even though people may have transmitted all the coded interviews and built flawed C++ software (yes, I am strongly opposed to coded interviews), people should learn it correctly and it is useless to repeat it over and over again.

In HPC (High performance Computing), a lot of software has been or is in the process of migrating from FORTRAN to Cellular computing, which I don't understand. Because migrating well-tested FORTRAN code to (untested) C++ doesn't make any sense to me. Why bother to change one programming language to another that is very similar? I still think that in the long run, the combination of Rust (for all products at the system level and GUI) and Julia (for machine learning) will be successful.

What is currently in use? Well, I've switched from TensorFlow/Keras to PyTorch, because I need too many custom / non-standard features. But that doesn't mean I don't use TensorFlow/Keras anymore. In 2020, I hope to move towards using only the Julia framework.

The above is a sample analysis of PyTorch1.3 and TensorFlow 2.0. have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 244

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report