thank you so much for these series, well explained
@user-or7ji5hv8y4 жыл бұрын
This is the best pytorch series I have come across. examples get right to the gist of lesson.
@patloeber4 жыл бұрын
thank you!
@npomfret Жыл бұрын
There are a couple of mistakes at around 14:30. You are using the state from the 'checkpoint' variable, where I think you should be using state from the 'loaded_checkpoint' variable. In general, I think this part of the tutorial would be clearer if you'd used two files, one for saving and one for loading. Also, a better IDE would highlight unused variables which might have helped avoid this mistake.
@geoffreyexoo3 жыл бұрын
Mr. Python Engineer does a good job, moves along at a reasonable speed.
@patloeber3 жыл бұрын
Thanks, glad you like it
@christinagiannoula31064 жыл бұрын
In 15min, lines 32 and 32 should change to "model.load_state_dict(loaded_checkpoint["model_state"])" and "optimizer.load_state_dict(checkpoint["optim_state"]), respectively.
@patloeber4 жыл бұрын
Oh you are correct! Thanks for the hint!
@baotography78294 жыл бұрын
Hi, Why not line 33 is: optimizer.load_state_dict(loaded_checkpoint["optim_state"])?
@unknown31583 жыл бұрын
@@baotography7829 Line 33 should be as you say.
@sarahjamal864 жыл бұрын
Like always beautiful video, I am giving your videos to all the beginners out there :-)
@patloeber4 жыл бұрын
Thanks so much :)
@amankushwaha89272 жыл бұрын
Very helpful video. Thanks
@chiruk28354 жыл бұрын
Excellent and very useful, I finished all 17 tutorials, theank you
@amerel-samman99294 жыл бұрын
Every pytorch video: "and you can ignore this warning right here" :P I am going to be first to fall into that trap. Great series! Thank you so much.
@ubaidghante86042 жыл бұрын
Great video, thanks man 👍🏻
@Footballistaas3 ай бұрын
hello, any advice how I can prep for interview for this?
@prajganesh4 жыл бұрын
Great series! it will be great if you can add more pytorch videos :)
@inesylla97064 жыл бұрын
thank you for the clear lesson! Really useful!
@patloeber4 жыл бұрын
glad you like it!
@longdang7791 Жыл бұрын
Hi, thank you for showing all the methods. I have a federated learning use-case where I train a single model using 32 clients. Currently, I have CUDA Out of memory issue. I want to know how each of the methods presented here affect the memory allocation and reservation on a single GPU. Any comment/idea is appreciate. Many thanks.
@MuhammadHussain-ws1xs3 жыл бұрын
Amazing video, can i confirm that by using this method we can do fine tuning, for example train our model on one dataset, then save and load the model (with the weights), we can then train on a similar dataset but using the loaded model with the saved weights, right?
@iNTERnazionaleNotizia5893 ай бұрын
Hi I want to ask, Is it possible to load a Pretrained model from other Dataset (such as BTCV or BraTS2021) , and use it for inference to a different dataset (such as ISLES 2022)?
@cyukore17964 жыл бұрын
very clear tutorial
@patloeber4 жыл бұрын
thanks!
@bijjalanaganithin37984 жыл бұрын
Thank You so much for this tutorial series
@patloeber4 жыл бұрын
Glad you like it:)
@nguyenduydatnguyenduydat26403 жыл бұрын
Thank you so much for making the wonderful tutorial! Would you like to correct again the part load checkpoint. I thought the command in line 32 33 should be model.load_state_dict(loaded_checkpoint['model_state']) and optimizer.load_state_dict(loaded_checkpoint['optim_state'])
@ahmedgdoura2184 жыл бұрын
Hi, in 8:07 why we see that requires_grad=True even when you set your model to .eval() mode thanx!
@patloeber4 жыл бұрын
Very good observation, sorry if I miscommunicated that! model.eval() will not deactivate the requires_grad! See here: discuss.pytorch.org/t/model-eval-vs-with-torch-no-grad/19615
@GurpreetSingh-si2gh2 жыл бұрын
Thank you very much.🙏
@shivanshchakrawarti92892 жыл бұрын
How do you save losses and accuracy in a csv file? after each epoch?
@erictian80754 жыл бұрын
Thanks for the great video! I have a question at 14:56, when you print the loaded optimizer.state_dict(), the lr is loaded correctly, but the 'params' are not the same. What do 'params' of the optimizer mean? If I have saved checkpoint at epoch 100 and want to resume training by loading checkpoint, does the inconformity of params influence my training?
@qhliucy4 жыл бұрын
'params' are always the memory addresses of params which you used to init the optimizer and will not change when you call optimizer.load_state_dict(). The memory addresses saved in checkpoint are meaningless unless you save and then load the checkpoint in the same process. In the video, the new optimizer is inited with the new model's parameters( optimizer = torch.optim.SGD(model.parameters(), lr=0) ).
@m3dXX4 жыл бұрын
Great series, thanks for your work. Could you cover topic of NN for non-linear regression tasks with PyTorch?
@patloeber4 жыл бұрын
I will consider this :)
@Sparklerated3 жыл бұрын
could you make video about semantic segmentation with ensemble model with different encoders on pytorch, thank you!
@tehreemsyed86214 жыл бұрын
Nice Explanation!! I trained my model on GPU and saved but when loaded my .pt file using CPU, got an error? RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0, and CPU! What should I do in this case? Thank you
@patloeber4 жыл бұрын
did you use map_location? device = torch.device('cpu') model = Model(*args, **kwargs) model.load_state_dict(torch.load(PATH, map_location=device)) Also, you must push all your tensors and the model to the same device (either to cpu or gpu)
@krishj80114 жыл бұрын
Awesome Tutorial..👍👍👍
@patloeber4 жыл бұрын
Thanks :)
@mywayluna17153 жыл бұрын
Thank you so much for your lecture! I tried to save all my testing model result with nii(image) format. Could you give me a tip for me? I saved and loaded model to test. I did the image segmentation, my goal is to get a predicted segmentation images.
@annemahoro99663 жыл бұрын
I need your help on how I can resolve below issues: RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.
@mohammadusamah8192 жыл бұрын
Hi I love your videos and it has been very much help for me. I have a question that how can we use pytorch custom models on different files
@omerbinali94723 жыл бұрын
How can we convert saved .pt model to .pb ?
@newajsorifnishad91693 жыл бұрын
Why my model run again after load. Pth file? Can u plz help me
@teetanrobotics53634 жыл бұрын
amazing video
@innotech40794 жыл бұрын
how to load *.pt?
@patloeber4 жыл бұрын
model = torch.load(filename.pt) or model.load_state_dict(torch.load(filename.pt))
@Dr.Bimechi3 жыл бұрын
tnx
4 жыл бұрын
Hey man i have been trying to reach you out via email. I need some help with a project that i am working on. lmk if you can help me out
@ewunate12 күн бұрын
Tanx
@ashwiniaditya84453 жыл бұрын
Your voice is irritating. Giving knowledge is one thing but that voice is distracting me from concentrating on the topic (looks like you are putting on an accent). And what is with ending each sentence like you are asking a question?
@lakeguy656162 жыл бұрын
HELP! I am confused. I have created and trained a model successfully. I have saved the model using the lazy method (torch.save(model, MODEL_NAME)) ** model_name is the file name and full path. Now, in a separate file(forecast), I want to load the trained model. So in this new forecast file, I've loaded the model from disk "model = torch.load("C:\\Users\\user\\Desktop\\datasets\ ain\\model.pth") " as per the lazy method. it generates an error message AttributeError: Can't get attribute 'NeuralNet' on
@longdang7791 Жыл бұрын
Do not use the lazy method. You should use the recommended ones to avoid this situation. After training is done, it is better to save the trained model and load it and do an evaluation on test data to confirm your model's prediction performance.