machrisaa / tensorflow-vgg

VGG19 and VGG16 on Tensorflow
2.21k stars 1.08k forks source link

Update utils.py to avoid skimage warning #25

Closed schaber closed 7 years ago

schaber commented 7 years ago

Avoid this warning from skimage.transform.resize: if mode is None: mode = 'constant' warn("The default mode, 'constant', will be changed to 'reflect' in " "skimage 0.15.")

machrisaa commented 7 years ago

I don't have any warning when 'mode' is not set. And according to the documentation, the default value for 'mode' is 'constant'. May I know which version of skimage are you using?

schaber commented 7 years ago

The code works fine now, and you are right the default mode is 'constant' currently, but in the future they will change the default mode. I am using skimage 0.13.0. You can see the warning in the skimage code here: https://github.com/scikit-image/scikit-image/blob/master/skimage/transform/_warps.py, lines 82-85.

machrisaa commented 7 years ago

After reading the documentation, I do not particularly want to use the 'constant' mode to handle the padding of the edges. The intention of resizing the image is that VGG only supports input with a particular size. The artefacts of the padding should barely affect the result of the classification. So I would suggest leave it as the default and let it be updated to be 'reflect' in the next version of the skimage and close this issue. Thanks your finding anyway.