Lesson 9 discussion

(Ravi Teja Gutta) #47

Hi all, I’m trying to understand the perceptual losses paper and having a hard time understanding this graph

I have a few questions

  1. Why does the loss remain constant for the perceptual losses method (green line)?
  2. Why does the x-axis say L_BFGS iteration when they are using Adam?
  3. In supplementary material, in case of super-resolution, for the convolutional layers in res_blocks , they didn’t use any padding because it causes artifacts.Because of that the output after 2 conv layers will be of different shape compared to input to res_block.To avoid this they center cropped the input to match the size of output of 2 conv layers.I can understand cropping raw images but at the res block stage they are features(whatever that means) right?, what is the intuition behind cropping features.


Hi, I can’t seem to download the word2vec from googledrive and can’t find it on http://files.fast.ai/part2/

Anyone figure out a way to get it?



Hi, where can I get “trn_resized_72_r.bc” and “trn_resized_288_r.bc” datasets from?



Found it here: http://files.fast.ai/data/

1 Like


Awesome thanks! It’s actually in here as well: Lesson 8 Discussion


(Eric Perbos-Brinck) #52

Note: the complete collection of Part 2 video timelines is available in a single thread for keyword search.
Part 2: complete collection of video timelines

Lesson 9 video timeline:

00:00:30 Contribute to, and use Lesson 8 Wiki

00:02:00 Experiments on Image/Neural Style Transfer

00:05:45 Advanced tips from Keras on Neural Style Transfer

00:10:15 More tips to read research papers & “A Neural Algorithm of Artistic Style, Sep-2015”

00:23:00 From Style Transfer to Generative Models

00:32:50 “Perpetual Losses for Real-Time Style Transfer & Super-Resolution, Mar-2016”

00:39:30 Implementation notebook w/ re-use of ‘bcolz’ arrays from Part 1.

00:43:00 Digress: how “practical” are the tools learnt in Part 2, vs. Part 1 ?

00:52:10 Two approaches to up-sampling: Deconvolution & Resizing

01:09:30 TQDM library: add a progress meter to your loops

01:17:30 Fast Style Transfer w/ “Supplementary Material, Mar-2016”

01:27:45 Ugly artifacts like “checkerboard”: cause and fixes; Keras UpSampling2D

01:31:20 ImageNet Processing in parallel

01:33:15 DeVISE research paper

01:38:00 Digress: Tips on path setup for SSD vs. HD

01:42:00 words, vectors = zip(*w2v_list)

01:49:30 Resize images

01:52:10 Three ways to make an algorithm faster:
memory locality,
parallel processing


Lesson 9 wiki
(Kevin Dewalt) #53

I found it at

wget -c "https://s3.amazonaws.com/dl4j-distribution/GoogleNews-vectors-negative300.bin.gz"

from https://groups.google.com/forum/#!topic/word2vec-toolkit/z0Aw5powUco


(Utkarsh) #54

When I use this file, I am getting very less number of matches than what is shown in the video lecture. You sure this is the file?


(Jonathan) #55

How long is training expected to take when training the super-resolution network? I’m using a GTX 1080 and it looks like training will take 30 min, which is longer than I would have expected:

[loss: 58328.617] 7% 1296/19439 [02:24<33:00, 9.16it/s]

This is much slower than when training previous CNNs. (I made sure to set VGG layers to not trainable, so that isn’t the problem.) I also checked my GPU usage while training using the nvidia-smi command, and GPU seems to have jumped since starting the training, suggesting that the GPU is indeed being used:

| NVIDIA-SMI 382.05                 Driver Version: 382.05                    |
| GPU  Name            TCC/WDDM | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|   0  GeForce GTX 1080   WDDM  | 0000:02:00.0      On |                  N/A |
| 37%   59C    P2   185W / 180W |   7169MiB /  8192MiB |     98%      Default |

(Arash A. Omrani) #56

Hi Matthew

When I run arr_lr = bcolz.open(‘trn_resized_72_r.bc’)[:]
I get error : FileNotFoundError: [Errno 2] No such file or directory: ‘trn_resized_72_r.bc\meta\sizes’

Do you know what is the problem?



(Matthew Kleinsmith) #57

When I run arr_lr = bcolz.open(‘trn_resized_72_r.bc’)[:]
I get error : FileNotFoundError: [Errno 2] No such file or directory: ‘trn_resized_72_r.bc\meta\sizes’

I don’t know this problem, and so by default I’d redownload the data. If that didn’t work, I’d explore this mysterious “\meta\sizes” thing, by studying the nature of bcolz arrays and how they’re stored (via bcolz documentation). Maybe the bcolz package updated and became out of sync with these bcolz arrays, which may have been created with an older version of bcolz.


(Arash A. Omrani) #58

Dear Matthew

Thanks for reply.
I have downgrade the bcolz to 1.0.0 but still the same problem.
To download the files again, it says I don’t have access. Can I get the access or it is just for people registered in the course?



(Matthew Kleinsmith) #59


You can find the data here: http://files.fast.ai/data/

Fast.ai moved their files from platform.ai to files.fast.ai.

To help you transcend me / generalize beyond me:

Fast.ai moves fast, and so information about them can go out of date fast. This applies to many posts on this forum. I didn’t have access to these files either with respect to the original link. I found the new link by going to course.fast.ai and pretending I was new. I soon ended up at the lesson 1 page and saw this:

“Important note: All files in the course are now available from files.fast.ai, rather than platform.ai, as shown in the videos.”

The following is the assumption that led me to this solution: Fast.ai cares deeply about being inclusive. Restricting access to learning materials is the opposite of being inclusive. Fast.ai would never do that. There must be another link.”


(Arash A. Omrani) #60

Dear Matthew

Thanks, I have downloaded the files and it works.



(Gavin Francis) #61

Why is AWS p2 slower than my MacBook Pro? I am running a small sample of images through the fast style transfer main algorithm. This takes 9 seconds per iteration on my MacBook Pro and 16 seconds per iteration on p2.xlarge. I thought Tensorflow was supposed to take advantage of a GPU automatically, resulting in a significant speed up!? Am I missing some configuration setting?


(Corbin Albert) #62

Have you ever experienced an issue like this before?

Run the following command in a tmux frame:

watch -n 1 nvidia-smi

then run the training and let us know if you see the GPU Util. % increase.

Lastly, what versions of keras and tf are you using? Is this the AWS instance set up using the fast.ai script? Or did you download tensorflow yourself? If the latter, you may have downloaded regular tensorflow instead of tensorflow-gpu?


(Gavin Francis) #63

Hi, thanks for replying to my question. I am running the Jupyter notebook in a Python 3.6 environment.
I tried the watch command and confirmed that the GPU Uilt %age rose to 100% when I started training.
I am using keras version 1.2.2 and tf.__version__1.1.0
I tried the Logging Device placement scrip on https://www.tensorflow.org/tutorials/using_gpu and confirmed that all operations were running on the GPU.
So as far as I can see the code is running on the GPU, just painfully slowly. To add to my worries I an now getting a ResourceExhaustedError when exactly the same code ran without producing this error last week. I can work around this by reducing the batch size from 18 to 8.
I am very confused. My p2.xlarge instance provides me slower run times and a smaller batch size limit that my MacBook. The only positive is that I got some very good results after running my MacBook for 18 hours. Yet I still have to question what I am paying for on AWS. Should I try setting up the whole p2.xlarge instance again from scratch?
Any other suggestions gratefully accepted.
Yours cheerfully, Gavin


(Corbin Albert) #64

I’ve got to admit that I’m stumped. You could certainly try redoing your AWS, but man what a pain in the ass…

Hmmm… It’s obviously using the GPU like you said. Just doesn’t seem to be doing anything, which… just doesn’t make any sense… Man, sorry I can’t be of more help.


(Gavin Francis) #65

Oh well, thanks again. I’ll keep trying to crack it. And guess what? My AWS bill just came through!


(Arash A. Omrani) #66

Dear all

Do you know how to implement the fast style transfer model in xcode using CoreML?
I have transferred the model to coreml model, but cannot predict its output and show it in Xcode.

Any comments?