My code works well with VGG19 loaded from a .mat file and is used in the following function like this (I use tensorflow 1.14.0) :
#initial method : load VGG1