
Originally Posted by
ChrisW67
You are probably either:
- not copying all the relevant run-time dependencies necessary for QT/OpenCV/Tensorflow to ingest and handle a protocol buffer file or,
- assuming the current working directory of the program is somewhere it is not and addressing the procotol buffer file with an unqualified name "realcool.pb" (i.e. the file open fails).
It may be something else, but we cannot see your system.
pbFile = "tensorflowfile.pb";
#pbFile = "./tensorflowfile.pb";
#pbFile = "C:/Users/Computer/Documents/Program/release/tensorflowfile.pb";
#pbFile = ":/file/release/tensorflowfile.pb";
using namespace cv;
neural_net=dnn::readNet(pbFile.toStdString());
neural_net.setPreferableBackend(dnn::DNN_BACKEND_OPENCV);
neural_net.setPreferableTarget(dnn::DNN_TARGET_CPU);
pbFile = "tensorflowfile.pb";
#pbFile = "./tensorflowfile.pb";
#pbFile = "C:/Users/Computer/Documents/Program/release/tensorflowfile.pb";
#pbFile = ":/file/release/tensorflowfile.pb";
using namespace cv;
neural_net=dnn::readNet(pbFile.toStdString());
neural_net.setPreferableBackend(dnn::DNN_BACKEND_OPENCV);
neural_net.setPreferableTarget(dnn::DNN_TARGET_CPU);
To copy to clipboard, switch view to plain text mode
The third code only works when I ran my program inside my machine and I understand that since it is the absolute directory of my pb file.
After I deployed the release, I ran all three "pbFile" then copied the release folder with the pb file inside and all dlls needed including opencv_411world.dll. Launched the program well but when I clicked the button which run the function containing neural_net nothing happenned. Even adding the pb file to the resource didn't solve.
Bookmarks