r/tensorflow • u/L_E_I • Apr 12 '18
Tensorflow's tutorial is sucks
Have played with TensorFlow for a while by reading and revising other's code. Now I want to read tensorflows tutorial carefully and learn tensorflow comprehensively. Then I find the official tensorflow's tutorial is really sucks. For one thing, there are to many see other pages, I have to click many links in order to get understand about a code in tutorial. For other thing, tensorflow's APIs are not unified. In https://www.tensorflow.org/get_started/eager, it tells me to load CSV file by tf.data.TextLineDataset, but in other page (https://www.tensorflow.org/api_docs/python/tf/TextLineReader), it tells me to load CSV file by tf.TextLineReader. Can they unify the tutorial?
17
Apr 12 '18
I learned tensorflow through Stanford's class notes and homework they post online. They also have slides posted and incomplete models as HW.
7
u/CastleNtheSky Apr 12 '18
I’m in the same boat. I’ve been trying to really get hands on for the last 4 weeks but it seems like every other line of code throws an error and I’ve got to google why. Oh eager executions is a test function only available in nightly builds? Cool. Thanks for telling me to install the vanilla api. It makes it hard to get the basics down. :( I’m stuck.
4
u/omgitsjo Apr 12 '18
I love TensorFlow and I completely agree. The documentation mistakes quantity for clarity. I had an easy enough time building my model and generator but couldn't get the Estimator export method to behave, despite following directions.
After two days of fighting I scraped it and used Keras. Done in twenty minutes.
2
Apr 12 '18 edited Apr 12 '18
Haha! Exact same experience. I spent days trying to get the estimator to save then finally gave up and moved to keras.
Strangely though, what should have been the same model never converged. I had to add batch normalization in order to get the same results that I got from straight tensorflow.
1
Apr 12 '18
I don’t find it necessary to use the dataset API. Maybe if you’re really trying to eek out every bit of performance you can it would be worth it, but just using feed_dicts is sufficient. I haven’t tried using it since they did away with the old way of loading the dataset, which was very inflexible and complicated, so I don’t know much about the new dataset API, but I find the feed_dict highly flexible and easy to use.
1
u/L_E_I Apr 12 '18
Yeah,simple knowledge is enough for some toy models, but when you want to dig deeper, the tutorial is really annoying
2
Apr 12 '18
I agree with you that the tutorials can be pretty incomplete to down-right confusing. But it really doesn’t have to be so complicated to do something more than a toy model. Eager execution is still pretty new so I haven’t worked with it yet. I think it’s probably best to avoid it until it’s more polished and there is more documentation.
Once you understand the tensorflow graph and how it works, tensorflow is really not so hard. It can be inflexible and difficult to do what you want, but the reasons why are understandable.
Granted I use tensorflow for things which are quite different than most users. I’m a chemist by trade so my use cases can be significantly different from a lot of users, but in the end I’m still doing regression on some input vector using a standard feed-forward network.
1
u/SemaphoreBingo Apr 12 '18
I've found that feed_dicts are significantly slower than using Datasets. The Dataset API isn't perfect but it's such a huge improvement on the alternatives that I'm willing to overlook its problems.
OP, use tf.data.TextLineDataset.
1
u/nitred Apr 12 '18
I think I'll defend Tensorflow here. I started using TensorFlow again recently after 6 months. Most of my old code is unusable because the API has completely changed since then, which is obviously frustrating. But after re-writing my code with the latest API, my code is much more readable and better structured.
There seems to have been one release every 1.5 months and each of these releases are non-trivial and they definitely have breaking changes or backwards incompatible changes to some parts of their code base. What is really under appreciated in the developer community is how long it actually takes to write good documentation for a piece of code. For me personally, writing "production ready" documentation for a function/class can take upto three hours making sure I cover all the caveats and writing documentation for a feature is at least a day long task. Therefore with their speed of development, I can see how it's so hard to document their work well. On top of that tutorials usually cover larger portions of the code base which is even more prone to having outdated content. Their priority will always be fix bugs > develop feature > write documentation > write tutorial > fix tutorial. Usually in such circumstances you'll have bloggers put up excellent tutorials where ever Tensorflow's tutorials are lacking. But I've seen that even their tutorials are outdated within a couple of months.
However there's some light at the end of the tunnel. After using it for the last week, I got the sense that the API is reaching a mature and finished stage and we may actually see more up to date tutorials and more in-depth tutorials soon (that's my optimistic opinion). The only reason one would use Tensorflow directly instead of Keras / TF-Estimator is because one would like to have more low level features. But anything that is low level is always going to be a murky mess. So I would recommend taking your time to learn TF slowly and with patience. Also consider contributing the tutorials and the documentation yourself :)
1
u/L_E_I Apr 13 '18
Yeah, I agree. I could understand that their team don't have enough time to perfect the tutorial currently. But still feel frustrating when reading it
1
5
u/Pwego-HR Apr 12 '18
Yeah i agree. I find it annoying that it leaves many holes in my knowledge about that framework. There is none actual full and decent tutorials on the internet. I actually needed to buy mutiple books about it and i still find myself unknowlingly dumb.