24 ms·
TensorFlow for Python is dying?
- paradite 4y agoI've been using Tensorflow.js for cross platform mobile app development together with React Native, and the experience is quite nice. I wonder if there are better alternatives than tfjs for cross-platform mobile apps.
- fnands 4y agoUgh, worked with Keras/tf last week for the first time in a few years. It's so hard going back to tf after working in PyTorch. It just feels so clunky, and progress was so slow.
- marcinzm 4y ago.
- capableweb 4y ago> The Stack Overflow graph doesn't seem to show what they say it does? I'm guessing you're referring to this? > PyTorch is still growing, while TensorFlow’s growth has stalled. Graph from StackOverflow trends (https://insights.stackoverflow.com/trends?tags=pytorch%2Ctensorflow%2Ckeras https://insights.stackoverflow.com/trends?tags=pytorch%2Cten...) Graph seems to confirm what they are saying, in terms of questions asked on Stack Overflow. Number of PyTorch questions are growing, number of TensorFlow questions have plateaued and maybe even shrinking, but bit early to tell. I wouldn't necessarily say that growing/shrinking number of questions on Stackoverflow means a project is less/more popular than another, can be because of number of factors (more experienced developers, better documentation, better support channels via some other platform, and so on), so I don't think the conclusion is 100% on spot. But at least the graph accurately describes what it's supposed to describe.
- gamegoblin 4y agoWhile PyTorch is obviously the future in the short term, it will be interesting to see how this space evolves. Before Tensorflow, people (myself included) were largely coding all of this stuff pretty manually, or with the zoo of incredibly clucky homemade libs. Tensorflow and PyTorch made the whole situation far more accessible and sane. You can get a basic neural network working in a few lines of code. Magical. But it's still early days. George Hotz, author of tinygrad[0], a PyTorch "competitor", made a really insightful comment -- we will look back on PyTorch & friends like we look back on FORTRAN and COBOL. Yes, they were far better than what came before. But they are really clunky compared to what we have today. What will we have in 20 years? [0] https://github.com/geohot/tinygrad https://github.com/geohot/tinygrad, https://tinygrad.org https://tinygrad.org
- KKKKkkkk1 4y agoPyTorch and Tensorflow were good enough to implement all the major advanves in recent years: the AlexNet successors, GPT, Stable Diffusion. It's not early days, and the market will not evolve unless there is a new application that cannot be served by PyT and TF.
- letitgo12345 4y agoTheano preceded Tensorflow by 8 years. So I don't think it was all manual coding before TF. Torch (in Lua) was also around much before TF
- gamegoblin 4y agoThat's definitely true, though worth noting that those libs didn't have anything close to the dominance the modern ones do. I was doing ML academia stuff in the pre-TF era, and most of my department was using custom C++/CUDA, or a pile of random stuff like https://en.wikipedia.org/wiki/Weka_(machine_learning) https://en.wikipedia.org/wiki/Weka_(machine_learning) and https://en.wikipedia.org/wiki/Waffles_(machine_learning) https://en.wikipedia.org/wiki/Waffles_(machine_learning). Our department also didn't even have GPUs to use for the first part of my time there, whereas now it would seem ridiculous to have an ML research wing without access to GPUs.
- quietbritishjim 4y agoI think the TensorFlow release roughly coincided with the widespread adoption of proper deep learning library, but it didn't cause it. In fact the first TensorFlow seemed to be just after (by 6 months to a year) the inflection point of deep learning library usage. At the time, there seemed to be a lively ecosystem but no clear winner. Theano, Caffe and Torch were the main hitters but there were smaller players too. Torch was particularly good, maybe functionally ahead (but I don't really remember for sure) but hampered because, at the time, it was Lua only. In fact Keras's first release said "Keras is a minimalist, highly modular neural network library in the spirit of Torch, written in Python / Theano so as not to have to deal with the dearth of ecosystem in Lua." When TensorFlow was released, it looked like that would be the death of all the other libraries. The fact that any others survived at all is really down to how hard to use TensorFlow was (/is?). It didn't live up to the expectation of being the killer of other libraries.
- flakiness 4y agoJAX should be mentioned [1]. It's also from Google and is getting popular these days. Not PyTorch-popular, but the progress and investment seem promissing. [1] https://github.com/google/jax https://github.com/google/jax
- jphoward 4y agoWhen I first read about JAX I thought it would kill Pytorch, but I'm not sure I can get on with an immutable language for tensor operations in deep learning. If I have an array `x` and want to set index 0 to 10, I cannot do: x[0] = 10 I instead have to do: y = x.at[0].set(10) I'm sure I could get used to it, but it really puts me off.
- atorodius 4y agoAgreed that that's a bit ugly but at least in the ML context you rarely if ever need to do this (personally I only do this on the input to models, where we use pure numpy).
- uoaei 4y agoI feel the same. There are probably more ergonomic and generalizable ways to do whatever it is you need to do. Treat it as functional programming and let the XLA compiler handle things.
- jpeter 4y agoLooks like Java code. It's doa
- voz_ 4y agoI disagree.
- bootsmann 4y agoI think JAX is behind pytorch in production usability tho. Its a tool for cutting-edge architecture research but it lacks infrastructure to actually deploy the models in a production environment.
- pjmlp 4y ago"These days, one can use TensorFlow with JavaScript, Java, and C++. The community is also starting to develop support for other languages like Julia, Rust, Scala, and Haskell, among others. PyTorch, on the other hand, is very centered around Python — that’s why it feels so pythonic after all. There is a C++ API, but there isn’t half the support for other languages that TensorFlow offers." This is also a big reason why CUDA won over OpenCL. NVidia recognised early on (around CUDA 3) that have a polyglot infrastructure was a much better option, so eventually plenty of toolchains started to target PTX, while OpenCL was stuck into "compile to C" alternative. It didn't help that AMD and Intel hardly did anything to improve the situation when SPIR finally came out.
- nicce 4y agoPeople don’t like to be vendor locked anymore. For that reason, they really do seek options to get out of NVIDIA monopoly.
- pjmlp 4y agoExcept Intel and AMD so far failed to provide a good development story for libraries, polyglot programming, and IDE tooling. Unless one is happy using vim and emacs to target GPUs, coding in C or C++, with either pixel debugging or lame printfs. Making fire with stones to avoid a proprietary lighter.
- jiggawatts 4y ago> Making fire with stones to avoid a proprietary lighter. I'm stealing that quote!
- latency-guy2 4y agoNVIDIA is so far ahead of the competition that people really do not care about the poor API that ROCm offers. Intel is not really a thing to even remotely care about for GPUs, they are still obviously important for CPU end. All the other players matter even less. I badly wanted something decent as an alternative to CUDA for quite a while, but even after leaving AI myself, it is clear they are not near the standards that NVIDIA has been offering for nearing a decade now already. We don't even have to get into all the issues consumers have gotten with AMD's GPUs.
- deleted 4y ago[deleted]
- college_physics 4y agoAs ML becomes "commoditized" easy integration with other tools will likely enable completely new applications. In this sense pytorch has an edge as far the python ecosystem goes, where it is more "native". But ultimately it will depend on what kind of such ML enabled "killer apps" become popular. Maybe they live in the browser or in some IoT and thus give the edge to js or c++ implementations rather than python.
- jstx1 4y agoI don't get the more native part - you can call a TensorFlow or a PyTorch model and get results from either in Python - what kind of integration are you imagining where the internal implementation of the model makes a difference?
- college_physics 4y agoI think people mostly refer to the debugging part while developing, not any other capabilities or API issues. So for example building a larger (monolithic) application entirely in python, where ML is only a part might be easier using pytorch.
- jstx1 4y agoWhy though? What specific thing does PyTorch do that TensorFlow doesn't do in a large monolithic Python application?
- college_physics 4y agoLike said, debugging that application is one difference [0] [0] https://sites.google.com/site/wildml2016nips/SculleySlides2.pdf https://sites.google.com/site/wildml2016nips/SculleySlides2....
- albertzeyer 4y agoThis is from 2016, i.e. really ages ago. This is for TensorFlow 1, graph mode. Now with eager mode TensorFlow 2, there is not much difference between debugging TensorFlow vs debugging PyTorch.
- yumraiha12 4y agoFolks mention the nativeness of Pytorch, but perhaps percieved simplicity is even better. Python is a simple language, and for many AI researchers pytorch was an easy way to not get bogged down in implementation details for rapid experimentation.
- deleted 4y ago[deleted]
- Havoc 4y agoIn the long run i expect this to move away from python entirely. Yes large piece of key loops are compiled but still doesn’t fit like a good fit for something this performance critical
- thom 4y agoI hope we end up with rich, cross-platform dataframe capabilities via Arrow, but even then you need a whole ecosystem of tools to work with and visualise data. Perhaps Julia takes over but we’re some way off truly polyglot data science.
- phonebucket 4y agoIt's more than a large piece of key loops that are compiled. Almost everything is compiled. Python hardly does anything beyond orchestration in modern scientific pipelines. Even loops written in Python can be compiled away. It's almost like you are coding in a separate language altogether sometimes. E.g. you write something in Cython that gets compiled to C/C++. Same holds for things like numba/LLVM or Jax/XLA. PyTorch is going bigger on compilation in PyTorch 2.0. Python can be seen as a common interface to write code that can be JIT compiled to multiple backends. It's quite convenient to be able to interact with all these backends, and bring the results back to a universally common interface (NumPy). From this perspective, scientific Python itself is somewhat evolving by itself into something like Julia, which is JIT compiled to LLVM. Except Python's momentum has generated a huge number of backends for users to choose from. I'm all for a new language dethroning Python in scientific computing. But I don't think it will be for reasons of speed. I think it'll likely be things like typing (e.g. from Dex lang) or library modularity (e.g. Julia).
- amelius 4y agoYes, Python is much like a .BAT file that calls .EXE and .COM files.
- matsemann 4y agoDoesn't really matter, as Python is only the glue, and the hot paths happen in native code or straight on the metal/gpu. But I'd wish there were as good libraries for typed languages. Exploratory coding in python is so hard, because you don't know what you can do with a library or your tensors etc.
- punnerud 4y agoIs StackOverflow the right metric? I started with TensorFlow, switched to Keras and then PyTorch. I had 100x the amount of questions with TensorFlow compared to PyTorch. With PyTorch I can jump into every part or the training process and easily debug. Often no need for StackOverflow. I am glad not have to deal with TF’s black box VM approach that seems optimized for selling Google products, more than solving machine learning.
- jstx1 4y agoIt's a big leap from "this isn't the most loved tool" to "dying a slow death". Plenty of companies use TensorFlow, some of them at huge scale, and they're getting stuff done with it just fine.
- NeutralForest 4y agoTF is being abandoned for JAX in many cases, most of the new things I see coming up in ML are done in JAX an Pytorch stays strong. It doesn't help that the TF docs are a catastrophe.
- GistNoesis 4y agoAll you need to know about JAX from JAX main github page : "This is a research project, not an official Google product. Expect bugs and sharp edges. Please help by trying it out, reporting bugs, and letting us know what you think!"
- NeutralForest 4y agoYeah it is for now but I'm not holding my breath for Google based projects and I can't see myself using TF in the future either.
- albertzeyer 4y agoJAX replaced TF by many Google research people internally, like Google Brain, and also DeepMind. However, TF is still very actively used by Google as well, esp for production. Google is big.
- NeutralForest 4y agoI just seen new interesting research using JAX like Kevin Murphy's "Probabilistic machine learning" https://probml.github.io/pml-book/ https://probml.github.io/pml-book/. Also using TF is a PITA so all in all, I don't want to spend time using it.
- pynchia 4y agoEnglish grammar is dying?
- albertzeyer 4y agoRegarding StackOverflow, PyTorch has a very active official forum: https://discuss.pytorch.org/ https://discuss.pytorch.org/ On StackOverflow, so many questions will get closed, as being too vague, unclear, duplicate, off topic, or whatever. I assume many people moved to the official forum instead. TensorFlow also recently (much later) has such a forum (https://discuss.tensorflow.org/ https://discuss.tensorflow.org/), but I think it's way less active.
- jmmcd 4y ago> For the sake of completeness, I’ve also included Keras in the figure below. It was released at around the same time as TensorFlow. But, as one can see, it’s tanked in recent years. The short explanation for this is that Keras is a bit simplistic and too slow for the demands that most deep learning practitioners have Keras is nowadays the front-end to TF, so this paragraph doesn't make sense. In light of this misunderstanding the author's views don't carry a lot of weight.
- Dayshine 4y agoThe big problem we have with tensorflow that means we're trying to move away from it the undocumented breaking changes. A model saved in 2.0 should work in any later 2.x version. In practice, they've changed the implementation of the batch normalisation layer at least twice, causing 3 sig fig differences in a unet. They just don't seem to care about production use of tensorflow.
- suyash 4y agoIt's about time to move out of 'Python prison' for ML frameworks. It was a good start for academics but for scalable enterprise deployment, python is a limiting language. I would love to see more ML Eng focussed libraries for Java, Swift, C# etc
- amelius 4y agoThis removes fragmentation, which is great. Competition is only good if it brings something to the table.
- mechanical_bear 4y agoTheir methodology of judging popularity is absurd.
- bigbillheck 4y agoOne of the pieces of evidence is the huggingface model zoo, and the proportion of torch-only vs tf-only models, but if you start poking around you'll notice just an overwhelming number of variations of the same few models that somebody has fine-tuned or maybe just used different random starts. If you search for 'distilbert-base-uncased-finetuned-emotion' (picked only because I noticed it a lot down in the tail) you'll find five hundred and twenty seven results. Are they all the same? Different? Who knows! I'm going to guess that there's some kind of 'learn ml' class that as part of the curriculum teaches students to upload to huggingface and that's skewing the numbers beyond use.
- prepend 4y ago> That being said, the data speaks a fairly simple truth. TensorFlow is, as of now, the most widespread deep learning framework. It gets almost twice as many questions on StackOverflow every month as PyTorch does. I don’t like how easy to measure things are conflated to mean more important things. SO traffic shouldn’t mean something is more widespread without some more information. Maybe PyTorch has great documentation and doesn’t need as many questions. Or maybe PyTorch users are on slack or irc for their questions. SO is a good sign that a tool is being used generally, but I don’t think should be used to compare. I think counts if SO are nominal and not even ordinal for purposes of a technology’s use. I’m not sure how to actually evaluate products. Maybe downloads? Or publications? Or referencing projects, although this is hard as there are many non-OSS projects that can’t be counted. Anyway, this seems to irk me since people will equate “n people tweeted” with meaning something other than “n people tweeted.” Like somehow something being measureable makes it mean something.
- kkielhofner 4y ago"TensorFlow has the better deployment infrastructure" Tensorflow Serving is nice in that it's so tightly integrated with Tensorflow. As usual that goes both ways. It's so tightly coupled to Tensorflow if the mlops side of the solution is using Tensorflow Serving you're going to get "trapped" in the Tensorflow ecosystem (essentially). For pytorch models (and just about anything else) I've been really enjoying Nvidia Triton Server[0]. Of course it further entrenches Nvidia and CUDA in the space (although you can execute models CPU only) but for a deployment today and the foreseeable future you're almost certainly going to be using a CUDA stack anyway. Triton Server is very impressive and I'm always surprised to see how relatively niche it is. [0] - https://github.com/triton-inference-server/server https://github.com/triton-inference-server/server
- snendroid-ai 4y ago> For the sake of completeness, I’ve also included Keras in the figure below. It was released at around the same time as TensorFlow. But, as one can see, it’s tanked in recent years. Seriously!? Author has no clear idea of what she's talking about. Keras IS THE front end of TF. They are not different, they are the same thing! > PyTorch is better for students and research > TensorFlow has the better deployment infrastructure Ammm... OKAY!? I'm not a TF fan or anything but reading some half baked absurd claims and saying one is better over another is just nuts. Both frameworks are built to satisfies the need of different demographics of projects, people and organizations. It's NICE to learn both, use both where required and I wish that both frameworks continuously evolves and make this space more accessible to built & deploy more complex solutions. Also f$%$ JAX, no one cares about you so just STFU.
- Kalanos 4y agodon't believe the hype https://docs.google.com/document/d/1TzRDJG97ipOOYL4njPLxz-OmcEOVQjqM3QtyaLXgUQo/edit https://docs.google.com/document/d/1TzRDJG97ipOOYL4njPLxz-Om...
- bilsbie 4y agoIs it possible to make a toy model in PyTorch to get a feel for how the networks work? And try out some ideas.
- MuffinFlavored 4y agoi think the problem you’ll run into is what use case do you have that will benefit from a trained model?
- npalli 4y agoThere are lies, damned lies and statistics. Looks like the entire article is premised on a single StackOverflow trends chart (really, everything else is opinion). For an alternate set of data points here is Francois Chollet) https://twitter.com/fchollet/status/1615020986298138626 https://twitter.com/fchollet/status/1615020986298138626
- polygamous_bat 4y agoJust FYI, fchollet is also one of the creators of Keras/TF, so it's hardly an unbiased data point.
- 10xDev 4y agoIs the data incorrect or somehow misleading? If the answer is no to both of these then your point is irrelevant.
- npalli 4y agoSure, he maybe unbiased but why do you say his data is unbiased. He is in fact showing other stackoverflow data points not just one cherry picked one like the article posted (and lot of opinion about what is going on).
- rg111 4y agoI can't say good things about Chollet, so I will refrain from saying anything. Another thing he likes to shout about is pip installs. PyTorch suggests and sets to default conda. Everyone gets PyTorch via conda. Chollet occasionally shouts about pip install numbers of PT vs. TF on Twitter and thus TF being superior.
- zone411 4y agoAnother data point that PyTorch overtook TF: https://trends.google.com/trends/explore?date=today%205-y&q=tensorflow,pytorch https://trends.google.com/trends/explore?date=today%205-y&q=...
- T3RMINATED 4y ago[dead]