bennetthardwick / darknet.js

A NodeJS wrapper of pjreddie's darknet / yolo.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: ../libdarknet.so: cannot open shared object file: No such file or directory

clement200 opened this issue · comments

Hi,
I compiled darknet with cuda, cudnn and cudnn_half successfully.
However when I try to run a simple script using the module I get this error:

`internal/modules/cjs/loader.js:1122
return process.dlopen(module, path.toNamespacedPath(filename));
^

Error: ../libdarknet.so: cannot open shared object file: No such file or directory
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object. (/home/user/test/node_modules/darknet/darknet.js:5:22)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)`

I'm running Ubuntu 18.04 and I have tried on different cuda versions with the same error.
This error occurs with the latest version of darknet.js with the alexeyab fork.
Any idea where this could be coming from?

@bennetthardwick I am seeing this too, I was doing a drop-in replacement for 2.0.17 to 3.0.0 on my express server that uses darknet. something to do with renaming of the shared lib, but I cant work it out either.

Should be fixed in 3.0.2. It was a weird difference between paths for static and shared libraries 🤦

Did the DARKNET_BUILD_WITH_OPENMP change? I am setting in my Dockerfile but the install_script.sh is reporting as DARKNET_BUILD_WITH_OPENMP= as 0

here you see the ENV is set.

root@45e9b5602b5c:/server# env
YARN_VERSION=1.21.1
HOSTNAME=45e9b5602b5c
PWD=/server
HOME=/root
NODE_VERSION=13.8.0
DARKNET_BUILD_WITH_OPENCV=0
TERM=xterm
SHLVL=1
DARKNET_BUILD_WITH_OPENMP=1
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
_=/usr/bin/env
root@45e9b5602b5c:/server# cd node_modules/
root@45e9b5602b5c:/server/node_modules# cd darknet/
root@45e9b5602b5c:/server/node_modules/darknet# ./in
include/           install-script.sh  
root@45e9b5602b5c:/server/node_modules/darknet# ./install-script.sh 
Interpreting DARKNET_BUILD_WITH_OPENMP= as 0

@bennetthardwick think found a issue

OOPENMPPENMP="${DARKNET_BUILD_WITH_OPENMP:-0}";

Jeez 🤦 Should be fixed in 3.0.3