Week 4, assignment 2 (Neural Style Transfer) slow on local computer

I have correctly solved and submitted the assignment and it surprised me at first how fast it runs on the Coursera cloud. Then, I downloaded the notebook and run it on my local computer with the same images, however, it takes much more time to obtain the image, indeed it takes around 2 minutes to perform 10 iterations. I am using the ‘imagenet’ option to obtain weights when loading the VGG19 model, but this is not the reason since I tried this option in the Coursera cloud and it is as fast as before. Which is the reason for this discrepancy of timings? Thanks.

It’s a matter of resources. I am not sure if Coursera Environment uses GPU or not, but usually CPU is slow for ML.

1 Like

Yes, perhaps your local pc is not as powerful as the AWS servers on which Coursera runs the notebooks. Even if you have a GPU on your machine, you may have to reconfigure your Jupyter instance to use CUDA for an Nvidia GPU or whatever the equivalent API is for a different GPU.

I expected so, thanks for the answer. I am not very familiar with GPUs, I have only seen few examples with NVIDIA and, as far as I know, in order to make use of them you need to explicitly call them in the code. However, the codes in the notebooks are CPU-style, is it because NVIDIA is a special case or maybe the Coursera cloud is internally prepared to parallelize the tasks using the GPUs?