Giter VIP home page Giter VIP logo

Comments (5)

brianhumphreys avatar brianhumphreys commented on June 2, 2024 1

As mentioned in the edits, I got passed this issue by running checkout manually and then running the next task in the install_darknet task group which is given the name build_darknet.

# Do every step for CPU-based only build.
install_darknet: download_darknet build_darknet sudo_install clean

After running make build_darknet, it seems to invoke the prepare_cuda task which doesn't seem right since I am only building for CPU usage. It fails with:

/Applications/Xcode.app/Contents/Developer/usr/bin/make -j 8
sudo apt-get install linux-headers-
sudo: apt-get: command not found
make[1]: *** [prepare_cuda] Error 1
make: *** [build_darknet] Error 2

This error makes sense because CUDA is not compatible with macs and apt-get is not a UNIX command. I am just curious why it's being invoked when building CPU on macs.

from go-darknet.

LdDl avatar LdDl commented on June 2, 2024 1

Describe the bug First of all, thanks for this repo! You've done a lot of amazing work that I'm excited to use! I am not sure if this is a bug or a mismatch in system compatibilities. It could also just be some github hiccup and in that case, my apologies for posting this here but I would appreciate any help! The issue seems to be that the reference to darknet repo at commit f056fc3b6a11528fa0522a468eca1e909b7004b7 is not a tree.

Command:

make install_darknet

Result:

rm -rf /tmp/install_darknet
mkdir /tmp/install_darknet
git clone https://github.com/AlexeyAB/darknet.git /tmp/install_darknet
Cloning into '/tmp/install_darknet'...
remote: Enumerating objects: 15386, done.
remote: Total 15386 (delta 0), reused 0 (delta 0), pack-reused 15386
Receiving objects: 100% (15386/15386), 14.01 MiB | 2.00 MiB/s, done.
Resolving deltas: 100% (10345/10345), done.
cd /tmp/install_darknet
git checkout f056fc3b6a11528fa0522a468eca1e909b7004b7
fatal: reference is not a tree: f056fc3b6a11528fa0522a468eca1e909b7004b7
make: *** [download_darknet] Error 128

To Reproduce

  1. git clone [email protected]:LdDl/go-darknet.git
  2. cd go-darknet/
  3. make install_darknet

Expected behavior Darknet compiles correctly

Describe the solution you'd like and provide pseudocode examples if you can If there are any workarounds to this issue on my system or glaring git mishaps occurring, I would love to know more in hopes that this issue helps others encountering this issue.

EDIT: I just went back over the README and noticed a potential issue. It states that the most recent battle-tested commit of the forked darknet is what go-darknet is using to build but while taking a peek in the Makefile, the LATEST_COMMIT variable is set to f056fc3b6a11528fa0522a468eca1e909b7004b7 which is not the same hash as the commit in the README. That hash is d65909fbea471d06e52a2e4a41132380dc2edaa6 and when attempting to change the LATEST_COMMIT variable to this hash, I get the same issue.

EDIT: The trouble command is when the Makefile runs git checkout $(LATEST_COMMIT) but when navigating to the /tmp/install_darknet directory and running the command manually, it switches refs just fine.

Hello there!

  1. Thanks, I've changed commit in README to f056fc3b6a11528fa0522a468eca1e909b7004b7
  2. About 'make build_darknet'
build_darknet:
	cd $(TMP_DIR)install_darknet
	sed -i -e 's/GPU=1/GPU=0/g' Makefile
	sed -i -e 's/CUDNN=1/CUDNN=0/g' Makefile
	sed -i -e 's/LIBSO=0/LIBSO=1/g' Makefile
	$(MAKE) -j $(shell nproc --all)
	$(MAKE) preinstall
	cd -

According to

/Applications/Xcode.app/Contents/Developer/usr/bin/make -j 8

I guess problem is in here:

$(MAKE) -j $(shell nproc --all)

Can you manually check if contents of 'build_darknet' work fine?

cd /tmp/install_darknet
sed -i -e 's/GPU=1/GPU=0/g' Makefile
sed -i -e 's/CUDNN=1/CUDNN=0/g' Makefile
sed -i -e 's/LIBSO=0/LIBSO=1/g' Makefile
make -j 8
make preinstall
cd -

p.s. Unfortunately, I haven't any macOS device :( So I'm 'blind' a bit.

from go-darknet.

brianhumphreys avatar brianhumphreys commented on June 2, 2024

Apologies for the delay!

From running manually, I get:

./src/yolo_layer.c:656:10: fatal error: use of undeclared identifier 'b'
    for (b = 0; b < l.batch; ++b) {

while the make -j 8 command is executing. Seems to be an issue with AlexeyAB's darknet implementation?

from go-darknet.

LdDl avatar LdDl commented on June 2, 2024

Seems so.
I'm trying to figure out stable commit of implementation: #23

from go-darknet.

brianhumphreys avatar brianhumphreys commented on June 2, 2024

Apologies for delay. I ended up getting this to work by reinstalling Xcode. This was the main issue, however, the build scripts are currently incompatible with mac. I plan on making a PR in the future but I do not have a clean implementation yet. For those running into this issue in the mean time, when running the make install_darknet task, I had to git checkout manually. Not sure why this was an issue but the commit could not be found when using the task.

Next, instead of using the build_darknet task, I ran the following script:

export TMP_DIR=/tmp

cd $TMP_DIR/install_darknet
sed -i -e 's/GPU=1/GPU=0/g' Makefile
sed -i -e 's/CUDNN=1/CUDNN=0/g' Makefile
sed -i -e 's/LIBSO=1/LIBSO=1/g' Makefile
/Applications/Xcode.app/Contents/Developer/usr/bin/make -j $(sysctl -n hw.ncpu)
/Applications/Xcode.app/Contents/Developer/usr/bin/make preinstall
cd -

Finally, to download the model, I used the following script:

curl https://cdn-images-1.medium.com/max/800/1*EYFejGUjvjPcc4PZTwoufw.jpeg -o sample.jpg
curl https://raw.githubusercontent.com/AlexeyAB/darknet/master/data/coco.names -o coco.names
curl https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/yolov4.cfg -o yolov4.cfg
sed -i -e "\$anames = coco.names" yolov4.cfg
curl https://pjreddie.com/media/files/yolov4.weights -o yolov4.weights

I hope this helps others and as I said I will make a PR in the future.

from go-darknet.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.