libopencv_highgui.so.3.2 not found - linux

I am linux ubuntu 20.4 user. I was trying to execute my code :
./darknet detector test ~/Documents/Data_challenge/Apple_detection_via_YOLOV4/main_folder/Model_ALL_views/obj.data ~/Documents/Data_challenge/Apple_detection_via_YOLOV4/main_folder/yolov4-tiny-test.cfg ~/Documents/Data_challenge/Apple_detection_via_YOLOV4/main_folder/Model_ALL_views/backup/yolov4-tiny-train_best.weights -thresh 0.20 -dont_show -out ~/Documents/Data_challenge/Apple_detection_via_YOLOV4/main_folder/Model_ALL_views/Prediction.csv < ~/Documents/Data_challenge/Apple_detection_via_YOLOV4/main_folder/Model_ALL_views/test.txt
This code took me this output
./darknet: error while loading shared libraries: libopencv_highgui.so.3.2: cannot open shared object file: No such file or directory
I searched what libraries is missing :
ldd darknet
So, I tried to find if libopencv_highgui.so.3.2 exist and where it is located : sudo find / -name "libopencv_hig*.
Then, it means libopencv_highgui.so.3.2 doesn't exist. I looked some forum about this problem :
#DavidChenTaipei (12 Dec 2019)
#guerillagorilla (24 Dec 2017)
but they doesn't work on my situation.

Related

CDLL can not find find shared object

I have shared object file libalgo.so in /usr/lib. ls -al /usr/lib gives
-rwxr-xr-x 1 root root 14264 Jul 6 06:57 libalgo.so
-rwxr-xr-x 1 root root 403496 Oct 8 12:07 libnlopt.so.0
I have to import this shared library in python
from ctypes import *
try:
lib = '/usr/lib/libalgo.so'
algo_lib = CDLL(lib)
print('algo_lib loaded')
except Exception as e:
print(e)
when running this code I get an error message saying could not read the shared object. No such file...
I have also added /usr/lib in LD_LIBRARY_PATH. This error only occurs in remote in which I am sshing into not in my local machine.
TL;DR The libalgo.so was compiled for arm.
We are developing for an arm system on x86 machines. One of the deb packages ended up with wrong shared object. Also error message given by python were misleading at best . instead of showing something like invalid object file , the message led me to believe that python could not find the file. I am not sure why such error message was given and any more information on this will be appreciated.

"error while loading shared libraries: libnvinfer.so.7: cannot open shared object file: No such file or directory" when running TRTorch sample

I'm trying to compile my pytorch model with TRTorch engine.
I've installed TRTorch according to this link.
When the sample code is run (with the below command from this link) the given error arise:
sudo bazel run //cpp/trtorchexec -- $(realpath /home/TRTorch/tests/modules/alexnet_scripted.jit.pt) "(1,3,227,227)"
error while loading shared libraries: libnvinfer.so.7: cannot open shared object file: No such file or directory
Also, the LD_LIBRARY_PATH is set correctly.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/TensorRT/TensorRT-7.0.0.11/lib
More info:
TRTorch: latest version (python package and binary)
TensorRT: 7.0.0.11
Pytorch: 1.5.1
CUDA: 10.2
Python: 3.6
I asked this question in TRTorch github and fixed it using:
sudo LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/TensorRT/TensorRT-7.0.0.11/lib bazel run //cpp/trtorchexec $(realpath tests/models/alexnet_traced.jit.pt) "(32 3 227 227)"
The issue is available here.

Compile error Facenet under ncappzoo modules

I forgot to mention about my system sorry.
I am using Ubilinux 4 which is based on Debian Stretch. Its kernel is 4.9 LTS. Also my GCC is 7 and Movidius NCSDK is 2.04.00.06. Also I have installed Tensorflow 1.6.
I installed all necessary packages and libraries to compile FaceNet module, but it gives error at every tries.
I have ınstalled NCSDK 2.04.00.06 and tested it, and also compiled some apps/modules like AgeNet and TinyYolo. They are working without problems.
But when I give "make all" under "~/ncappzoo/tensorflow/facenet/", It gives this error:
making prereqs inception_resnet_v1.py exists, not regetting it.
making zipped model Zipped model already exists, skipping download
making model Zip file exists. Zip file unzipped. mv:
'model-20170512-110547.ckpt-250000.data-00000-of-00001' durumlanamadı:
Böyle bir dosya ya da dizin yok mv:
'model-20170512-110547.ckpt-250000.index' durumlanamadı: Böyle bir
dosya ya da dizin yok meta file exists Converted directory exists,
skipping conversion. #( Here says there is neither a file nor a directory named facenet_celeb_ncs.graph )
If you want to reconvert remove directory: facenet_celeb_ncs, and re-run
making compile Command line: mvNCCompile facenet_celeb_ncs.meta -w
facenet_celeb_ncs -s 12 -in input -on output -o
facenet_celeb_ncs.graph mvNCCompile v02.00, Copyright # Intel
Corporation 2017
Illegal instruction cp: 'facenet_celeb_ncs.graph' durumlanamadı: Böyle
bir dosya ya da dizin yok #( Here says there is neither a file nor a directory named facenet_celeb_ncs.graph )
I haven't tried to upgrade my movidius SDK because I may need update ncappzoo apps that I have modified.
I have problem with just FaceNet module and others works without an issue.
Also, I erased this "20170512-110547" directory and tried "make all" again and same issue still here.
making prereqs inception_resnet_v1.py exists, not regetting it.
making zipped model Zipped model already exists, skipping download
making model Zip file exists. Unzipping. Archive: 20170512-110547.zip
inflating: 20170512-110547/20170512-110547.pb inflating:
20170512-110547/model-20170512-110547.ckpt-250000.data-00000-of-00001
inflating: 20170512-110547/model-20170512-110547.ckpt-250000.index
inflating: 20170512-110547/model-20170512-110547.meta Converted
directory does not exist, doing conversion Illegal instruction
making compile /bin/sh: 7: cd: can't cd to
20170512-110547/facenet_celeb_ncs Command line: mvNCCompile
facenet_celeb_ncs.meta -w facenet_celeb_ncs -s 12 -in input -on output
-o facenet_celeb_ncs.graph mvNCCompile v02.00, Copyright # Intel Corporation 2017
Illegal instruction cp: 'facenet_celeb_ncs.graph' durumlanamadı: Böyle
bir dosya ya da dizin yok #( Here says there is neither a file nor a directory named facenet_celeb_ncs.graph )
How can i solve this problem. Thank you.
I found a solution for my issue. According here: https://github.com/tensorflow/tensorflow/issues/17411#issuecomment-370260582 I should downgrade my Tensorflow package. So after given this command:
python3 -m pip install tensorflow==1.5.0 --user
my issue solved. Thank you.

NS 2 Installation error : narrowing conversion of 252 from int to char

I am working on VANET. for that, i need to install NS2 on my fedora 24 system. NS 2 version - ns 2.34 . During the installation process, i followed all the steps of ns 2.34 and made changes in the respective files. But at last, i found an error like the one attached in the screenshot.
Error: narrowing conversion of 252 from 'int' to 'char' inside play.xbm
I am unable to solve this error. Please guide me for this. enter image description here
I solved the problem.
Refer to:error: narrowing conversion of ‘194’ from ‘int’ to ‘char’ inside { }
Add-funsigned-char to the L48 of the Makefile in the /ns-allinone-2.34/nam-1.15 directory
image:
the code was added like this
i followed all the steps of ns 2.34
Some old "ns2 tutorials" were valid only for a very short time.
Fedora 24 :
Your compiling errors : g++ version 6.3 is OK with ns-2.34, but patching is required. I.e. ns-2.34 was built for g++ version 4.1.2.
ns234_gcc49.patch https://drive.google.com/file/d/0B7S255p3kFXNZDNyV1BPZHhEY0U/view?usp=sharing
cd ns-allinone-2.34/
patch -p0 < ns234_gcc49.patch
./install
P.S. : ns-allinone-2.34 + ns234_gcc49.patch was tested OK with two different Fedora 24 : The 64bits version and the 32bits version. ns-allinone-2.34 can of course also be compiled as is / no changes : export CC=gcc34 CXX=g++34 && ./install
Requires : # dnf install compat-gcc-34-c++

How correctly to link program against library

I run ./myprogram and it gives me a warning:
Warning: Your program was compiled with SimGrid version 3.13.90, and then linked against SimGrid 3.13.0. Proceeding anyway.
Tryldd myprogram and it gives following:
libsimgrid.so.3.13.90 => /usr/lib/libsimgrid.so.3.13.90 (0x00007f338ef47000)
Then I go to usr/lib and type ll *sim* in terminal:
lrwxrwxrwx 1 ken ken 21 июл 28 19:29 libsimgrid.so -> libsimgrid.so.3.13.90*
-rwxrwxr-x 1 ken ken 12307480 июл 28 19:29 libsimgrid.so.3.13.90*
In CMakeLists.txt I link library simgrid in such way:
target_link_libraries(CSim2Sim simgrid)
Why myprogram still links against SimGrid 3.13.0 (it doesn't exist in /usr/lib while SimGrid 3.13.90 does)?
UPDATE:
Command locate libsimgrid.so in ternimal gives:
/home/ken/Downloads/simgrid-master/lib/libsimgrid.so
/home/ken/Downloads/simgrid-master/lib/libsimgrid.so.3.13.90
/home/ken/SimGrid/lib/libsimgrid.so
/home/ken/SimGrid/lib/libsimgrid.so.3.13.90
/usr/lib/libsimgrid.so
/usr/lib/libsimgrid.so.3.13.90
The message seems buggy, it looks like your application was actually compiled with 3.13.0, and linked to libsimgrid 3.13.90. The order was inverted in the message, I will fix that.
It could be a problem with your includes when you compile your code, I think. Please check that you don't use old versions of msg.h/simgrid_config.h files when you compile your app (maybe there are still one in /usr/include ?).
To check, you can look for SIMGRID_VERSION_PATCH in simgrid_config.h. it should be 90 in a recent one, not 0.

Resources