https-deeplearning-ai / GANs-Public

Course notebooks for GANs specializations
MIT License
109 stars 84 forks source link

FreezeD Model Not Downloading Correctly #2

Closed gmongaras closed 2 years ago

gmongaras commented 3 years ago

In the 'Checkpoint' part of the notebook, a model named 'stylegan-256px.pt' is supposed to be downloaded from a google drive link. If you examine the contents of the downloaded file, the contents are HTML code. Within this HTML code, you can find a link to download the actual model, but if you don't download the actual model, issues will arise later in the code. For me, I had an issue stating "invalid load key, '<'." when running the code under the "Fine-tuning StyleGAN on Anime Faces" header before I realized the model was an HTML file instead of a model.

gmongaras commented 3 years ago

I also found some other issues with the same notebook:

  1. If a CPU is used to load the model, a Cuda GPU will still be attempted to be used to load the model. Adding the following argument to torch.load() fixed the issue: map_location=torch.device(device)
  2. Under the inference block, @torch.no_grad should be changed to @torch.no_grad()

Thank you for providing some of these great resources to help learn more about GANs! I'm hoping these issues can be resolved to help others running into the same issues.

sharobsinha commented 2 years ago

Hi, Thanks a lot for your valuable feedback. I will forward this to the team. Sorry for the inconvenience! We will try to investigate and solve this problem. Thank you.