justadudewhohacks / justadudewhohacks/opencv4nodejs
readNetFromTensorflow issue
- Dominant language
- C++
- Stars
- 5.1k
- Forks
- 826
- PR merge metrics
- No merged PRs in 30d
Description
```
const cv = require('/opncvnode/node_modules/opencv4nodejs');
const path = require('path');
const inceptionModelPath = './models';
const modelFile = path.resolve(inceptionModelPath, 'tensorflow_inception_graph.pb');
const classNamesFile = path.resolve(inceptionModelPath, 'imagenet_comp_graph_label_strings_cn.txt');
const net = cv.readNetFromTensorflow(modelFile);
```
error was
```
const net = cv.readNetFromTensorflow(modelFile);
^
ReadNetFromTensorflow - OpenCV Error: (FAILED: fs.is_open(). Can't open
"C:\Users\SHAN\Desktop\test\models\tensorflow_inception_graph.pb") in cv::dnn::ReadProtoFromBinaryFile, in file C:\opncvnode\node_modules\opencv-build\opencv\opencv\modules\dnn\src\caffe\caffe_io.cpp, line 1132, status -2
(Use `node --trace-uncaught ...` to show where the exception was throw
```
How to fix that
Node version v12.18.0
opencv4nodejs version ^5.5.0
npm version 6.14.4
Contributor guide
Research direction
The report names no repository file or test; start at the cv.readNetFromTensorflow(modelFile) entry point and inspect how the resolved .pb path is passed to OpenCV. Reproduce with the listed Node.js and opencv4nodejs versions, checking the supplied model path. Done means the cause is confirmed and a supported resolution is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs, opencv
- Domain
- computer-vision
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100