I am working on pre-trained vgg16 model, for that I need to have input size of image file to be (224,224,3). The code I am working on is: Help me in resolving the issue. Answer The error says the solution: src.type() == CV_8UC1 meaning you need to set your image type to the uint8 source So if you redefine your