How to use TFRecords with the Dataset and Estimator APIs in TensorFlow. github.com/Hva... This tutorial does NOT work with TensorFlow 2 and later versions, and it would take too much time and effort to update it.
Пікірлер: 67
@strachol136 жыл бұрын
I have managed to get 78% accuracy on 'test set' pictures (on the 'train set' the loss hovers around 0.02-0.002) after some tweaks to the actual files in datasets. I changed them so those are more equal in numbers. (there were too much spooneys). Also I shufled the pictures in test and train folders so those are more uniform and not that test folder is full of cutlery on grass as opposed to more abstract backgrounds in the train folders. (This was using CNN approach) the end spread of predictions was very uniform 82,102,107 and with 78% accuracy I think it is preety good score on such 'hard' dataset. So the code is definitelly on the good side. Also people, please remember that after trying different approaches you must actually restart your model (delete chackpoints) bacause if it is already overfitted (by past training sessions with bad approaches) then trying to fix it is nearly impossible. It's better to start with clean model and then when results are better then continue on the same model by doing smaller tweaks. I learned so much from this tutorial especially by experimenting. Thank you very much! It was awesome.
@hvasslabs6 жыл бұрын
Thanks very much for posting your experiments! I'm glad to know that the code was fine but the data-set just needed some tweaking!
@strachol136 жыл бұрын
After another tweaks I got the model to 88.3% accuracy on test set mainly by adding 2 convolutional layers, experimenting with kernel sizes, strides and number of filters in each convolutional layer. Also adding another flettened layer helped a bit. The code is good platform to make experiments with custom models. That's great if your main goal is to learn more and not just use one of the complete ones in keras like lenet, resnet50 etc.
@hvasslabs6 жыл бұрын
That is very cool, thanks for posting your results! Have you tried doing Hyper-Parameter Optimization on the model? See Tutorial #19.
@girlmeetsboynfallsn5 жыл бұрын
GitHub.io › io › tf-slim › 2016/12/21 Web results Tfrecords Guide - Daniil's blog Dec 21, 2016 · A post showing how to convert your dataset to .tfrecords file and later on use it as a part of a computational graph. @PROPERTYSPROMO
@Kaizala19336 жыл бұрын
Thanks dude, working with tf.Data has jus been a pain in the ass for the past 4 days...
@bendesign55555 жыл бұрын
Very useful tutorial thanks again! Can you omit the Estimator API and use the TFRecords on their own?
@richardf91125 жыл бұрын
What a fantastic tutorial!!! Informative and well organized thank you so much
@hvasslabs5 жыл бұрын
Thank you!
@mihailmihaylov65564 жыл бұрын
Hi! I have followed your tutorials and they are all extremely helpful. These are the only good tutorials I have found. One question though, would you make an update on how to load tfrecords with tfdataset and a customer estimator for the "beloved" tensorflow 2 ? I have been struggling for quite some time now, and I cannot find any reasonable documentation whatsoever. Thanks in advance!
@hvasslabs4 жыл бұрын
Thanks for the compliment! I recently updated some of the tutorials to TensorFlow v.2 but I won't be updating the others. It simply takes too much time and effort for me. If you have found out how to do it yourself by modifying this tutorial, then please put the modified version on github and post a link here.
@weichengzhu66056 жыл бұрын
Hi Hvass, thank you for your nice tutorials. Any suggestion or tutorial on using estimator and dataset API for tensorflow serving? Thanks
@hvasslabs6 жыл бұрын
If you can't find any tutorial on that subject then you should make one.
@weichengzhu66056 жыл бұрын
Hvass Laboratories Yeah, that's a good idea. I mean for the estimator it's not supposed to be used in the way that to call the predict in production because every time it reloads the model from file systems. Instead, the estimator is supposed to be used with the TF serving. Need to add the serving receiver input_fn and then export the model. From tutorial point you've done great work.
@hvasslabs6 жыл бұрын
朱伟成 That makes sense, thanks for pointing it out. There wasn't much information available on this topic when I made this tutorial, that's why it wasn't clear to me. You really should consider making a tutorial on this because you seem to know a lot more about it. Feel free to build on my tutorial if you like. Please post a link here so others may find it.
@youmustbenewhereguy4 жыл бұрын
Hi, nice tutorial. A question tho, If I have 2D array float as an input, not an image, do I have to .tostring() and wrap it in bytes too? doing that somehow returning different size of array when parsing it back.
@malekibrahim76974 жыл бұрын
Can you still use these functions if your data labels are not one-hot encoded?
@BeGunNer6 жыл бұрын
7:26 HAhaha so much saltiness Hvass. I love this video, but I started out laughing to a bunch of code in on a screen in a cafe. This does not make me look like a normal person.
@hvasslabs6 жыл бұрын
Hehe ... You have it easy because I have learned this material the hard way and then I communicate it to you so you can learn it much more easily. I have wasted a ton of time because of crap API, crap documentation and crap code. So I am mad sometimes and need to vent my frustration :-)
@blackrachmaninov5 жыл бұрын
Very nice video ! How to deal with a label which is a list and not a single value ?
@sam416195 жыл бұрын
many thanks for uploading this. Just a quick note: I have a task where I need to resize the images before making tfrecords, I used cv2 for resizing followed by 'img.tostring()' but when I saw the size of tfrecords file, it was quite large, I tried using python's native file open to store the image in tfrecord without downsizing and the resultant size of tfrecord file was much lower. Any comments on that?
@engin-hearing59783 жыл бұрын
Thank you! super useful :-)
@noli-timere-crede-tantum6 жыл бұрын
I wish code reviews at work were done in this fashion. Painful, but instructive
@hvasslabs6 жыл бұрын
Thank you!
@timephonic6 жыл бұрын
Hi Magnus, Your tutorials are very helpful. I was wondering can you make a tutorial on handling multilabel image classification in tensorflow?
@hvasslabs6 жыл бұрын
You shouldn't expect it as it takes a very long time to research and make these videos and that is not really a topic I am interested in myself. Why not do it yourself?
@timephonic6 жыл бұрын
Relax. Yup sure. Good idea.
@PavanKumar-jc1qn5 жыл бұрын
Hi, This is an Excellent presentation. After watching your video I am trying to run another deep learning program that uses estimators written in tensorflow but the gpu utilization is stuck at 8%. How can I improve the GPU utilization. Any pointers? Thank you Regards, Pavan
@hvasslabs5 жыл бұрын
This is a quite broad question and it may be due to many factors. It could be that your GPU is actually not used by TensorFlow at all - if you run KZbin in the background that might show up as 8% GPU usage. If TensorFlow is actually using the GPU, then it could be because your Neural Network is very simple. I haven't used the Estimator API since I did this video, but if you just use normal Keras, then the problem can also be that your batch-size is too small.
@divyamehta52825 жыл бұрын
Great tutorial Thanx for help.
@MQ2011de6 жыл бұрын
I like this man.
@balajichetty3055 жыл бұрын
Hi, Nice tutorial. In my case, I am using model.fit method. And I am getting the following error. TypeError: Unrecognized keyword arguments: {'input_fn': , 'steps': 200} help me how to use in model.fit Thanks
@ThibaultNeveu6 жыл бұрын
Thank for this video!
@syedjameer95116 жыл бұрын
Hello Hvass Laboratories Can please make a video session image captioning . It is really worth of learning and I have learned CNN from your tutorials.But when move to image captioning . It is combination of ENCODER AND DECODER. So could you please make a video session on image captioning. It would be helpful
@hvasslabs6 жыл бұрын
I don't think I will do a video on that topic. It takes me a very long time to research and produce these videos, and I pay for it myself, so I have to be very selective about the topics I cover.
@kislaykunal89216 жыл бұрын
Ok, so if anybody had access denied you have to specify a file name for the records, not just a directory name.
@EdBordin6 жыл бұрын
The reason the API is so hard to use is that it comes straight out of the protobuf compiler... they should have wrapped it in a higher level API.
@PadminiMansingh4 жыл бұрын
How to split own image dataset by xtrain and xtest
@suharsh966 жыл бұрын
THANK YOU !. I THOUGHT I WAS STUPID
@Salmariazi6 жыл бұрын
Thank you so much for this tutorial! Tensorflow documentation is horrible!
@christianherz29165 жыл бұрын
I felt the same way! 7:27 really made me laugh.
@nathanclin705 жыл бұрын
Could you provide the link to the tutorial in Chinese? Thanks
Yes. I guess the reason people feel hard to understand tf api is that we do not have a good "context".
@jianxiongji76046 жыл бұрын
lol what is that tutorial in Chinese?
@mohitkaushik12924 жыл бұрын
2 years passed and the APIs are still a pain..
@tingnews72735 жыл бұрын
Hi there. Why not make a tutorial about the tensor2tensor. I found the idea of it is very important. And just like the api. It's hard to modify to impliment the new paper. If you can find another chinese tutorial and teach us. It will be helpful for the guys outside google
@hvasslabs5 жыл бұрын
Why don't you make it? I think I've done enough.
@tingnews72735 жыл бұрын
@@hvasslabs You know when learn google things . Just cant get it . Learn it again and again , sitll just hello world . Run the example is ok. But advance tutorial . For example. My own dataset or want to implement some paper. Dont how to do it.....
@arkoraa6 жыл бұрын
subbed for 7:26
@hvasslabs6 жыл бұрын
TURTLE Nerdgasm! I meant to say TOTAL Nerdgasm :-)
@Leibniz_283 жыл бұрын
Waiting for the tf2 tutorial
@hvasslabs3 жыл бұрын
Try and hold your breath while waiting :-)
@蜜熊胖胖猪6 жыл бұрын
Don'y you think the whole open source community nowadays become more and more arrogant? Like if you don't understand their description than it is your fault. And I really can not understand, why those people write descriptions and examples so abstract, I don't believe their brains are more complicated than normal one's, the only reason they write a shit I could image is just arrogant attitude。 But of course, they will say: this is a free tools, you do not pay anything, why you still complain?
@hvasslabs6 жыл бұрын
Did you watch my video titled Pulp Code? You might like it :-)
@marr736 жыл бұрын
they might be ignorant too
@swordflyshen84392 жыл бұрын
Theme: API document sucks
@PadminiMansingh4 жыл бұрын
May I have ur mail-id sir
@girlmeetsboynfallsn5 жыл бұрын
GitHub.io › io › tf-slim › 2016/12/21 Web results Tfrecords Guide - Daniil's blog Dec 21, 2016 · A post showing how to convert your dataset to .tfrecords file and later on use it as a part of a computational graph. @PROPERTYSPROMO