Given the recent explosion of interest in deep learning, how do you go about choosing a deep learning framework?
I faced this same question nearly two years ago when I started my journey in deep learning. At that time (and even today), the two major competitors were Tensorflow and Pytorch (which I’ll focus on here). However, it is important to note that the framework landscape is constantly changing- while researchers have largely moved on from some frameworks (e.g. Torch and Theano), new frameworks are also gaining traction quickly (e.g. fast.ai).
Tensorflow is backed by Google, while Pytorch is backed by Facebook. One of the major differences between these two frameworks is that Tensorflow uses static computational graphs, while Pytorch uses dynamic computational graphs (although this will change with eager execution being featured more prominently in Tensorflow 2.0). I eventually ended up choosing Pytorch for a couple of reasons (many of which are mentioned in the graphic above):
- Learning curve: I found Pytorch relatively easy to learn, with good documentation and many helpful tutorials online. I also found working with dynamic graphs to be much more intuitive- when I tried out Tensorflow, having to create sessions and placeholders before being able to use a graph was always somewhat confusing.
- Speed of development: I found Pytorch to be very pythonic, making it easier to debug. Errors in Tensorflow, on the other hand, can often be cryptic. I also feel that Pytorch strikes a good balance between its level of abstraction and flexibility, making it easy to test out new ideas. For example, Pytorch DataLoaders have made working with all different types of data a breeze.
- Community: The Pytorch forums are a good source of information and useful for getting answers to questions. The Pytorch community is also growing rapidly, with more and more papers being cited (Pytorch even seems to have caught up with Tensorflow!)
In conclusion, I have found that Pytorch suits my needs as a deep learning researcher, providing a relatively stable API while allowing for fast prototyping of new ideas. Given its growing popularity, I believe Pytorch will be sticking around for a while.
P.S. If you are converting models between different frameworks, I have found the MMdNN tool to be helpful. It is also easily hackable, for when things don’t work right out-of-the-box .