Save and Load a Model with TensorFlow's Keras API

Поділитися
Вставка
  • Опубліковано 24 гру 2024

КОМЕНТАРІ •

  • @deeplizard
    @deeplizard  4 роки тому +1

    👉 Check out the blog post and other resources for this video:
    🔗 deeplizard.com/learn/video/7n1SpeudvAE
    👀 Come say hey to us on OUR VLOG:
    🔗 ua-cam.com/users/deeplizardvlog

  • @VedantPratik
    @VedantPratik 18 днів тому +1

    I can`t thank you enough, This video is so simple and understandable , U r legend ; U r great , u explained the basics so wonderful , Thanks a lot , Right now i am working on my University project on Deep Learning , i am following your youTube channel , this clears my every doubt, Thanks Again Sister

  • @EduardoRohdeEras
    @EduardoRohdeEras 4 роки тому +7

    Best tutorial by far in Keras... finally someone who truly teaches! Thank you a lot!

  • @Sikuq
    @Sikuq 4 роки тому +8

    Mandy, your Jupyter Code runs beautifully in VSCode step-by-step with your video. Your narration speed is perfect. What more can I say, a perfect learning experience in every aspect. Deeplizard is hands down the Best of Breed in its class.

    • @deeplizard
      @deeplizard  4 роки тому

      Thank you, Christian! 😊😊

  • @miamadison
    @miamadison 3 роки тому +1

    I'm so proud of you guys :)

  • @Muuip
    @Muuip 2 роки тому +1

    Great concise tutorials! much appreciated! 👍

  • @furkatsultonov9976
    @furkatsultonov9976 4 роки тому +2

    Just crazy! Directly-to-the-point explanation. Keep up the good work!

  • @nadja3125
    @nadja3125 3 роки тому

    Oh my, this is real teaching

  • @mdarifurrahmananik4686
    @mdarifurrahmananik4686 3 роки тому +1

    THANK YOU . IT WAS HELPFULL :)

  • @tymothylim6550
    @tymothylim6550 3 роки тому +1

    Thank you very much for this video! It was really eye-opening and this is gonna help me a lot with my assignment, especially with learning how to load models created by others!

  • @nachiketmore9463
    @nachiketmore9463 4 роки тому +2

    Thanks for the explaination!!!

  • @theprimordialdude1138
    @theprimordialdude1138 4 роки тому +1

    Thank you very much for this video. This topic is really very important to know.

  • @ladycoder2095
    @ladycoder2095 4 роки тому +1

    Very well explained 👏👏👏

  • @yournemesis8232
    @yournemesis8232 2 роки тому +1

    Thankss aa lootttt , this helped meeee

  • @nakulmali1413
    @nakulmali1413 4 роки тому +1

    Thanks for your keras video playlist. Please upload one playlist on Tensorflow 2.X from beginner to advance .

  • @manishkumarkn
    @manishkumarkn 9 місяців тому +1

    your are awesome ❤

  • @codewithluq
    @codewithluq 2 роки тому +1

    This video has saved my ....

  • @franciscomassucci
    @franciscomassucci 3 роки тому

    Great content! I'm struggling to save my custom tf.keras model to a .pb file, in order to deploy it with opencv dnn. It would be awesome if you covered this topic in a future video!

  • @fikiledube6745
    @fikiledube6745 4 роки тому

    Thank you for this insightful tutorial! Question: After viewing the weights, how does one find the most important inputs in the model? That is, the ones that contribute more to the output?

  • @RizwanAli-jy9ub
    @RizwanAli-jy9ub 3 роки тому

    So you can use json to save model and use save weights and then combine these two so you have same function as saving model

  • @qnr9584
    @qnr9584 4 роки тому

    This is very good!
    Please make a github that we can try much more!
    good luck

  • @arjunkashyap8896
    @arjunkashyap8896 4 роки тому

    Hey Mandy !! Love your explanations. I have a cliche question. What do you prefer between pytorch and tensorflow ?

  • @tingnews7273
    @tingnews7273 4 роки тому +3

    I think I can give the viewer more infomation about:
    1. The 1st way have some problems :
    1.1. Embedding weights not save
    1.2 Custom function should declear both save and load
    1.3 Stage only save the steps (no epochs)
    2. 2 & 3 use together
    BTW. I dont know why . I tell some feelings. When I first saw the videos before . I can feel the passion or know something I dont know . EG. the east egg after each video makes me think . But now I found myself just go to school to listen to the teacher . Yeah , another class I have to take. just like that . I dont know what happend. Just feelings. Hope to give some feedback to your guys .

    • @deeplizard
      @deeplizard  4 роки тому

      Always appreciate your thoughtful comments and feedback! This course is more instructional in nature in how to use the Keras API step-by-step. I think the Easter eggs you're referring to are the deeper insights we would share at the end of the Reinforcement Learning episodes and some of the PyTorch episodes, right?
      Since we're only focusing on using the use of the API in this course (so far, at least), it didn't seem as fitting to include the deeper insights here. Keep the feedback coming, always happy to hear from you! :)

    • @tingnews7273
      @tingnews7273 4 роки тому

      @@deeplizard soga

    • @deeplizard
      @deeplizard  4 роки тому

      I don't know what soga means, and Google doesn't appear to be giving me a relevant description 😬

    • @tingnews7273
      @tingnews7273 4 роки тому +1

      @@deeplizard this come from japanese word そっか which should pronunce to sokka but sogga in daily life. It measns So it turns out . Its popular in Chinese young generations.

  • @DANstudiosable
    @DANstudiosable 4 роки тому +1

    Very clean explanation, thank you!
    I have a doubt, hope it'd get cleared. Can't we save a Keras models under .pb extension? If we can, can u make a tutorial on that. Because a large amount of 3rd party softwares(like OpenVINO) makes use of models with .pb extension for making inferences. No one has given a clear explanation on how we can save it under .pb extension. If you can make a tutorial on that, it'll be really helpful.

    • @deeplizard
      @deeplizard  4 роки тому +1

      In TF 2.x and later, you can use the same model.save() function but don't include ".h5" in the filename. Then I believe the Keras model will be saved as a pb file.

    • @DANstudiosable
      @DANstudiosable 4 роки тому

      @@deeplizard That worked. Thank you!

  • @Despamifier
    @Despamifier 2 роки тому

    Hi, can I save and load the .JSON architecture and import weights into it?

  • @yepnah3514
    @yepnah3514 4 роки тому

    Good tutorial. Question, after training and saving a model, is there a way to multiply the trained weights before loading them into a new model so I can see how it performs w/o training again? for example: (trained weights)*.95

  • @dworld0203
    @dworld0203 2 роки тому

    Good afternoon, I have a question about retraining, how can I do retraining if I already have a trained model?

  • @thurawin4996
    @thurawin4996 3 роки тому

    Can I save/load multiple keras neural network models into one .h5 file?

  • @fabytruth11
    @fabytruth11 4 роки тому +1

    Hello, deeplizard!
    I've just trained my first model after watching your great course.
    I saved the model as a .pb, but I need also a .pbtxt file. I googled many ways to convert the .pb model, but none of them worked. Can you recommend a way to convert the model? The only files I got after saving the model are saved_model.pb, variables.data-00000-of-00001 variables.index.

  • @dutchy5752
    @dutchy5752 3 роки тому

    hi, if I for instance trained a model with 3 features (for stock price prediction), close price, volume and a moving average using LSTM. The length of the sequence is e.g. the last 20 points. Then when I have saved the model and load it back up can I extract information from the saved model about which features have been used and the sequence length that is used? The Sequence length I can extract but I do not see how I can extract information about which features have been used. I guess I need to save that to a separate file? This assuming I can't remember which features I used to train that particular model. For instance if I load the model 1 week after I trained it and I do not know or can't remember the features and sequence length I used. How would you retrieve this info? Can it be retrieved from a H5 file? Thanks.

  • @khenpahilanga9596
    @khenpahilanga9596 Рік тому

    Hello, I used the first method but I get an error unknown keras layer, its saying i need to pass it to the custom objects

  • @manojrajsr6001
    @manojrajsr6001 4 роки тому +1

    pls, help me out. When I run the saving model cell, I get so many lines of error, and the last line is mentioned below.
    OSError: Unable to create file (unable to open file: name = 'models/medical_trail_model.h5', errno = 2, error message = 'No such file or directory', flags = 13, o_flags = 302)
    what should I do now?

    • @manojrajsr6001
      @manojrajsr6001 4 роки тому +2

      ok, I figured it out.....
      instead of that cell..running the below lines fixed that problem..
      import os.path
      if os.path.isfile(r'C:\Users\\medical_trail_model.h5') is False:
      model.save(r'C:\User\\medical_trail_model.h5')

    • @SpinMasterStringing1
      @SpinMasterStringing1 4 роки тому

      @@manojrajsr6001 thanks for mention that awesome answer.

  • @garriedaden4168
    @garriedaden4168 3 роки тому

    I'm working on a Dell PC with Win10 and all the latest API's. The model.save() command worked without throwing an exception but when I opened the actual .H5 file in Jupyter Notebook it said "Error!... Saving Disabled....model.h5 is not UTF encoded.....see console for more details". I googled this error for an hour or so before eventually deciding to open the file with the Windows notebook app and saw that it actually did contain lots of data not apparent through the Jupyter browser. The file also seems to faithfully reproduce the model when the load_model() function is used. So consider disregarding this error if encountered.
    Compliments to deeplizard for code that appears to be 100% right and scrupulously maintained.

    • @deeplizard
      @deeplizard  3 роки тому

      Good to know Garrie, thanks!

  • @sandrinskiy8417
    @sandrinskiy8417 4 роки тому

    Does it work for theano backend? I use the method but my "model.h5" didn't appear in a folder... and there is no any error message.

  • @ZOBAER496
    @ZOBAER496 Рік тому

    Say we are going to save a trained CNN model. Can we save only the trained convolutional base part instead of saving the entire model including the fully connected part? The purpose is mainly to use the convolutional base as pretrained feature extractor and fine tune the fully-connected part. How can we do that?

  • @kesavae9552
    @kesavae9552 3 роки тому

    does this work in google colab

  • @vidumini23
    @vidumini23 4 роки тому +1

    ❤️❤️

  • @kalpanakonety8317
    @kalpanakonety8317 2 роки тому

    What if we have custom layers ? None of these work, might need custom objects to save?

    • @joshmiller3712
      @joshmiller3712 2 роки тому

      you can pass custom objects as arguments in the load_model function and then you should be all set

  • @moonblue1100
    @moonblue1100 3 роки тому

    please help me. When i run i have an errror:
    ValueError: Unknown activation function:softmax_v2

  • @NaveenKumar-lb5cx
    @NaveenKumar-lb5cx 3 роки тому

    I saved my model using model.save(path). In another python script, I loaded the model and used the model.predict() function. But costs me almost 10s. I have time constraint of 5s. Can anyone help me with this? Pls suggest me a better way to load the model and predict.

  • @annie157
    @annie157 3 роки тому

    Every where is loading but didnt say on how to use that to do prediction

  • @mohammedsohilshaikh6831
    @mohammedsohilshaikh6831 3 роки тому

    Hii everyone.
    AttributeError: 'str' object has no attribute 'decode'
    got this error while loading the saved model using load_model method.
    Inside the .h5 file I found the following lines.
    filename.h5 is not UTF-8 encoded saving disabled. see consol for more details

  • @abuk95
    @abuk95 4 роки тому +1

    you have only this tshirt? :D

  • @math_hms
    @math_hms 4 роки тому

    i'm in love.. u so beautiful !. And good explanation, thanks!!!

  • @MrLucky281188
    @MrLucky281188 3 роки тому

    Plz dont make vdos in bedroom