Hacker News new | ask | show | jobs
by microtonal 2449 days ago
We are considering to move to PyTorch, we really dislike how the Tensorflow 1.x -> 2.0 transition is handled. For years a lot of stuff has been added to tf.contrib, some things were only in tf.contrib and now that it's dropped in TF a lot of project (including ours) have to do quite large rewrites. Since the last few 1.x iterations, Tensorflow has been complaining that the older RNN layers are deprecated and that we have to move to Keras RNN layers, which they claim to be equivalent. However, when we tried a couple of months back, it made RNN-based training 45% slower. It is all fixable, but it takes time and a lot of testing of all the model variants to see if there are no regressions. It feels quite a bit worse than Python 2 -> 3.

I am a bit saddened by all of this, because I really liked how easy it is to define a graph in Tensorflow in Python, serialize it, and then use its minimalistic C API to use the graph in Go, Rust, or wherever you need it.

How is your experience with PyTorch and backwards API compatibility (I know that they only reached 1.0 fairly recently)?

3 comments

There has basically only ever been one major API shift, which was the shift away from Variables. And, granted, that happened from 0.3->0.4, about a year after the initial release.

Other than that, I've had next to no issues, and the API has only gotten better over time, with more convenient ways to do things.

PyTorch has a much smaller footprint, and is happy to delegate code to separate libraries (e.g. torchvision), so you run into "all-or-nothing" dilemmas less frequently.

It's been pretty good with PyTorch. The API has been fairly stable and I've adopted code developed from 0.4.0 to 1.0.0+ with barely the need for any tweaks. Granted, it's a younger project so for now things are stable but maybe 3 years from now they may have some giant API refresh. But I find their API quite nice for the most part so I don't see them needing to switch everything up periodically.
Wait, pytorch is torch at its core, right? That is almost 10 years old and the last rewrite was version 7.
that’s what we did. We had a popular open source project using TF 1.x

For it’s successor we chose Pytorch instead of TF 2 and have been very happy with this decision

Could you please share your open source project?