Exception with OpenCV4.5.5 DnnSuperResImpl - ReadModel (C++) - c++

I have a issue when using OpenCV dnn module.
Here are my settings:
Building OpenCV 4.5.5 with extra module opencv_contrib-4.x (clone from github)
Downloading EDSR_x4.pb and EDSR_x3.pb from EDSR_tensorflow
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_x3.pb");
Results from using command "dir"
C:\Users\user\source\repos\ZBAR_OpenCV4.5\ZBAR_OpenCV4.5
2022/06/13 afternoon 01:39 201,562 EDSR_x3.pb
2022/06/13 afternoon 10:40 206,908 EDSR_x4.pb
2022/06/07 afternoon 11:37 3,124 ZBAR_OpenCV4.5.cpp
2022/06/07 afternoon 11:37 544 ZBAR_OpenCV4.5.h
2022/06/13 afternoon 02:05 8,719 ZBAR_OpenCV4.5Dlg.cpp
2022/06/13 afternoon 11:37 1,627 ZBAR_OpenCV4.5Dlg.h
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'

The solution is really simple.
Just check if the integrity of EDSR_x4.pb is a pb file or a html, and I incorrectly used the later.
So, I download from the github again, and it worked.

Related

Issue in building Tensorboard 1.13.1 from source (cfg must be either 'host' or 'target')

I am trying to build Tensorboard (1.13.1) from source. I am using Bazel version 0.26.0 (built from source) and JDK version 11.0.3. I am getting following error during build:
# bazel build --incompatible_disallow_filetype=false --incompatible_bzl_disallow_load_after_statement=false tensorboard
Starting local Bazel server and connecting to it...
ERROR: /root/.cache/bazel/_bazel_root/4e113d18791d4c114d32fe59cdd54b1a/external/io_bazel_rules_closure/closure/compiler/closure_js_library.bzl:343:17: Traceback (most recent call last):
File "/root/.cache/bazel/_bazel_root/4e113d18791d4c114d32fe59cdd54b1a/external/io_bazel_rules_closure/closure/compiler/closure_js_library.bzl", line 335
rule(implementation = _closure_js_lib..., <2 more arguments>)
File "/root/.cache/bazel/_bazel_root/4e113d18791d4c114d32fe59cdd54b1a/external/io_bazel_rules_closure/closure/compiler/closure_js_library.bzl", line 343, in rule
attr.label_list(cfg = "data", allow_files = True)
cfg must be either 'host' or 'target'.
ERROR: error loading package '': in /root/.cache/bazel/_bazel_root/4e113d18791d4c114d32fe59cdd54b1a/external/io_bazel_rules_closure/closure/defs.bzl: Extension file 'closure/compiler/closure_js_library.bzl' has errors
ERROR: error loading package '': in /root/.cache/bazel/_bazel_root/4e113d18791d4c114d32fe59cdd54b1a/external/io_bazel_rules_closure/closure/defs.bzl: Extension file 'closure/compiler/closure_js_library.bzl' has errors
INFO: Elapsed time: 14.290s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
If I search and replace the word 'data' with 'host' from .bzl files, I start getting another error:
# bazel build --incompatible_disallow_filetype=false --incompatible_bzl_disallow_load_after_statement=false tensorboard
ERROR: error loading package '': in /root/.cache/bazel/_bazel_root/4e113d18791d4c114d32fe59cdd54b1a/external/org_tensorflow/tensorflow/workspace.bzl: Label '#org_tensorflow//third_party:nccl/nccl_configure.bzl' crosses boundary of subpackage '#org_tensorflow//third_party/nccl' (perhaps you meant to put the colon here: '#org_tensorflow//third_party/nccl:nccl_configure.bzl'?)
ERROR: error loading package '': in /root/.cache/bazel/_bazel_root/4e113d18791d4c114d32fe59cdd54b1a/external/org_tensorflow/tensorflow/workspace.bzl: Label '#org_tensorflow//third_party:nccl/nccl_configure.bzl' crosses boundary of subpackage '#org_tensorflow//third_party/nccl' (perhaps you meant to put the colon here: '#org_tensorflow//third_party/nccl:nccl_configure.bzl'?)
INFO: Elapsed time: 15.377s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
Correcting the error by replacing,
load("//third_party:nccl/nccl_configure.bzl", "nccl_configure")
by
load("//third_party/nccl:nccl_configure.bzl", "nccl_configure")
in the cache file,
/root/.cache/bazel/_bazel_root/4e113d18791d4c114d32fe59cdd54b1a/external/org_tensorflow/tensorflow/workspace.bzl
Solves the error but now getting this error:
# bazel build --incompatible_disallow_filetype=false --incompatible_bzl_disallow_load_after_statement=false tensorboard
ERROR: /root/.cache/bazel/_bazel_root/4e113d18791d4c114d32fe59cdd54b1a/external/org_tensorflow/tensorflow/workspace.bzl:18:1: file '#io_bazel_rules_closure//closure:defs.bzl' does not contain symbol 'filegroup_external'
ERROR: error loading package '': Extension file 'tensorflow/workspace.bzl' has errors
ERROR: error loading package '': Extension file 'tensorflow/workspace.bzl' has errors
INFO: Elapsed time: 1.113s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
Now I am stuck. Any pointers highly appreciated!

Error: Module build failed: Error: Couldn't find preset "react-app" relative to directory "/[project] frontend"

I am following the tutorials to create a react app using create-react-app.
There were a number of dependencies that didn't get installed when loading the webpack-dev-server.
I get the following error when I try to npm run start.
What does this mean and can anyone tell me what is needed to fix it?
Module build failed: Error: Couldn't find preset "react-app" relative to directory "/[Proeject folder]/frontend"
run npm install babel-preset-react-app

Python script hangs on ubuntu server using selenium firefox driver

I'm trying to take screenshots of some webpages. I opted for selenium and firefox. I'm using xvfb and setting an environment variable for the display.
The script works fine without xvfb on OS X desktop. However on the server the script hangs after webdriver.Firefox() is issued as if the python script is no longer executing. No exception is ever raised and firefox is still active in my process list.
Setup:
sudo Xvfb :10 -ac
export DISPLAY=:10
test.py
from selenium import webdriver
print 'start'
firefox = webdriver.Firefox()
print 'Hello?'
firefox.quit()
print 'done!'
output:
start
cursor winks tauntingly
I Had the same problem with Chrome. Also tried the phantomJs flash fork, this was successful but did not capture flash content.
starting independently firefox gives
(process:3278): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' f failed
Xlib: extension "RANDR" missing on display ":10".
Error: Access was denied while trying to open files in your profile directory.
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default
(firefox:3278): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
//bin/dbus-launch terminated abnormally without any error message
Please help
Thanks!

sylius installation issue PHP Fatal error:

Please help.
PHP Fatal error: require_once(): Failed opening required
'/home/roberto/sylius/app/bootstrap.php.cache'
(include_path='.:/usr/share/php:/usr/share/pear') in /home/roberto/sylius/app/console on line
15
How did you install Sylius? You should use Composer which will run bootstrap file generation script.

chef-solo from_file had an error out bash /tmp/chef-script returned 1, expected 0

Im having this error appear on chef-solo recipes, Im new to it so I dont really get this error or how to fix it... still sounds like either file or dir not found, created...
out: [Fri, 18 Mar 2011 15:59:28 +0000] ERROR: script[Install_Requirements] (/etc/chef/cookbooks/main/recipes/rincon.rb:35:in `from_file') had an error:
out: "bash" "/tmp/chef-script20110318-7369-1hi8q5e-0" returned 1, expected 0
This is the recipe that shows the error.
script "Install_Requirements" do
interpreter "bash"
user "rincon"
group "rincon"
cwd "/tmp"
code <<-EOH
/home/rincon/sites/rinconcolombia/bin/pip install -r /home/rincon/sites/rinconcolombia/checkouts/rinconcolombia/requirements.txt
EOH
end
Ive been using chef-solo -l debug flag and its been giving me all the info I need to debug this problem... Thank you all hope this works for you should you find yourself in the same caveat