Exception with DnnSuperResImpl - ReadModel ()

I have a issue when using OpenCV dnn module.

Here are my settings:

  1. Using Visual Studio 2017 to build OpenCV 4.5.5 with extra module opencv_contrib-4.x (clone from github)

  2. Downloading EDSR_x4.pb and EDSR_x3.pb from EDSR_tensorflow

  3. move .pb files to root directory of my project

However, no matter I used relative path or absolute path, readModel() failed for these two path:

DnnSuperResImpl sr;
sr.readModel ("EDSR_x4.pb");
sr.readModel ("C:\\Users\\user\\source\\repos\\ZBAR_OpenCV4.5\\ZBAR_OpenCV4.5\\EDSR_x4.pb");

Exception printed out:

code= -2
err= FAILED: ReadProtoFromBinaryFile(param_file, param) Failed to parse GraphDef file: EDSR_x4.pb

func= cv::dnn::ReadTFNetParamsFromBinaryFileOrDie

line= 42

msg= OpenCV(4.5.5) C:\OpenCV4.5\opencv\sources\modules\dnn\src\tensorflow\tf_io.cpp:42: error: (-2:Unspecified error) FAILED: ReadProtoFromBinaryFile(param_file, param). Failed to parse GraphDef file: EDSR_x4.pb in function 'cv::dnn::ReadTFNetParamsFromBinaryFileOrDie'


what= OpenCV(4.5.5) C:\OpenCV4.5\opencv\sources\modules\dnn\src\tensorflow\tf_io.cpp:42: error: (-2:Unspecified error) FAILED: ReadProtoFromBinaryFile(param_file, param). Failed to parse GraphDef file: EDSR_x4.pb in function 'cv::dnn::ReadTFNetParamsFromBinaryFileOrDie'

I guess I should transform .pb files to some kinds of format?

no, no, not nessecary.
it’s probably still a path problem. remember, that relative pathes are relative to where your program starts (which might be a debug / release folder)

if it’s not that, check file integrity. length ok ? is it really a pb or an html error msg ? (throw it at some text editor)

Thanks for your quick reply. You are really an experienced solver.
The pb file is actually a html.

Yet, I went to next step, and still got a problem:
I put a Mat (276X372) as an argument in upsample (), and it takes 135 seconds.
Does it mean I need a GPU card or something?