ImportError: cannot import name ‘pad’ from ‘skimage.util’

I got following error after upgrading skimage package

It's because skimage has removed pad API starting from version 0.18 (https://github.com/scikit-image/scikit-image/issues/4147)

Solution

So we should use np.pad instead of skimage.util.pad, and this issue will be fixed.