AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.71k stars 7.96k forks source link

compiling error for darknet #503

Open guoqiang01486 opened 6 years ago

guoqiang01486 commented 6 years ago

some compile error log:

obj/tree.o -o darknet -lm -pthread obj/parser.o: In function parse_reorg_old': parser.c:(.text+0x1a66): undefined reference tomake_reorg_old_layer' obj/parser.o: In function parse_network_cfg_custom': parser.c:(.text+0x47a0): undefined reference tomake_reorg_old_layer' collect2: error: ld returned 1 exit status Makefile:87: recipe for target 'darknet' failed make: *** [darknet] Error 1

anyone can help me besides, my cuda version is: nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2016 NVIDIA Corporation Built on Tue_Jan_10_13:22:03_CST_2017 Cuda compilation tools, release 8.0, V8.0.61

is it responsible for this ?

thank you !

AlexeyAB commented 6 years ago

Probably you use some old commits with some new commits.

Try to download whole current version: https://github.com/AlexeyAB/darknet/archive/master.zip

As you can see it can be compiled on the Linux successfully: https://circleci.com/gh/AlexeyAB/darknet/144?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

guoqiang01486 commented 6 years ago

thank you very much for your reply however it doesn't work

but l use original Makefile to replace this https://github.com/AlexeyAB/darknet/blob/9c1b9a2cf6363546c152251be578a21f3c3caec6/Makefile#L1

now everything is ok ! Is there any other questions ? sorry l can't access this website https://circleci.com/gh/AlexeyAB/darknet/144?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

my original Makefile:

GPU=1 CUDNN=1 OPENCV=1 DEBUG=1 OPENMP=1 LIBSO=1

ARCH= -gencode arch=compute_30,code=sm_30 \ -gencode arch=compute_35,code=sm_35 \ -gencode arch=compute_50,code=[sm_50,compute_50] \ -gencode arch=compute_52,code=[sm_52,compute_52] \ -gencode arch=compute_61,code=[sm_61,compute_61]

#Tesla V100 #ARCH= -gencode arch=compute_70,code=[sm_70,compute_70]

#GTX 1080, GTX 1070, GTX 1060, GTX 1050, GTX 1030, Titan Xp, Tesla P40, Tesla P4 #ARCH= -gencode arch=compute_61,code=sm_61 -gencode arch=compute_61,code=compute_61

#GP100/Tesla P100 ?DGX-1 # ARCH= -gencode arch=compute_60,code=sm_60

# For Jetson Tx1 uncomment: # ARCH= -gencode arch=compute_51,code=[sm_51,compute_51]

#For Jetson Tx2 or Drive-PX2 uncomment: #ARCH= -gencode arch=compute_62,code=[sm_62,compute_62]

VPATH=./src/ EXEC=darknet OBJDIR=./obj/

ifeq ($(LIBSO), 1) LIBNAMESO=darknet.so APPNAMESO=uselib endif

CC=gcc CPP=g++ NVCC=nvcc OPTS=-Ofast LDFLAGS= -lm -pthread COMMON= CFLAGS=-Wall -Wfatal-errors

ifeq ($(DEBUG), 1) OPTS=-O0 -g endif

CFLAGS+=$(OPTS)

ifeq ($(OPENCV), 1) COMMON+= -DOPENCV CFLAGS+= -DOPENCV LDFLAGS+= pkg-config --libs opencv COMMON+= pkg-config --cflags opencv endif

ifeq ($(OPENMP), 1) CFLAGS+= -fopenmp LDFLAGS+= -lgomp endif

ifeq ($(GPU), 1) COMMON+= -DGPU -I/usr/local/cuda/include/ CFLAGS+= -DGPU LDFLAGS+= -L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcurand endif

ifeq ($(CUDNN), 1) COMMON+= -DCUDNN CFLAGS+= -DCUDNN -I/usr/local/cudnn/include LDFLAGS+= -L/usr/local/cudnn/lib64 -lcudnn endif

OBJ=http_stream.o gemm.o utils.o cuda.o convolutional_layer.o list.o image.o activations.o im2col.o col2im.o blas.o crop_layer.o dropout_layer.o maxpool_layer.o softmax_layer.o data.o matrix.o network.o connected_layer.o cost_layer.o parser.o option_list.o darknet.o detection_layer.o captcha.o route_layer.o writing.o box.o nightmare.o normalization_layer.o avgpool_layer.o coco.o dice.o yolo.o detector.o layer.o compare.o classifier.o local_layer.o swag.o shortcut_layer.o activation_layer.o rnn_layer.o gru_layer.o rnn.o rnn_vid.o crnn_layer.o demo.o tag.o cifar.o go.o batchnorm_layer.o art.o region_layer.o reorg_layer.o reorg_old_layer.o super.o voxel.o tree.o ifeq ($(GPU), 1) LDFLAGS+= -lstdc++ OBJ+=convolutional_kernels.o activation_kernels.o im2col_kernels.o col2im_kernels.o blas_kernels.o crop_layer_kernels.o dropout_layer_kernels.o maxpool_layer_kernels.o network_kernels.o avgpool_layer_kernels.o endif

OBJS = $(addprefix $(OBJDIR), $(OBJ)) DEPS = $(wildcard src/*.h) Makefile

all: obj backup results $(EXEC) $(LIBNAMESO) $(APPNAMESO)

ifeq ($(LIBSO), 1) CFLAGS+= -fPIC

$(LIBNAMESO): $(OBJS) src/yolo_v2_class.hpp src/yolo_v2_class.cpp $(CPP) -shared -std=c++11 -fvisibility=hidden -DYOLODLL_EXPORTS $(COMMON) $(CFLAGS) $(OBJS) src/yolo_v2_class.cpp -o $@ $(LDFLAGS)

$(APPNAMESO): $(LIBNAMESO) src/yolo_v2_class.hpp src/yolo_console_dll.cpp $(CPP) -std=c++11 $(COMMON) $(CFLAGS) -o $@ src/yolo_console_dll.cpp $(LDFLAGS) -L ./ -l:$(LIBNAMESO) endif

$(EXEC): $(OBJS) $(CPP) $(COMMON) $(CFLAGS) $^ -o $@ $(LDFLAGS)

$(OBJDIR)%.o: %.c $(DEPS) $(CC) $(COMMON) $(CFLAGS) -c $< -o $@

$(OBJDIR)%.o: %.cpp $(DEPS) $(CPP) $(COMMON) $(CFLAGS) -c $< -o $@

$(OBJDIR)%.o: %.cu $(DEPS) $(NVCC) $(ARCH) $(COMMON) --compiler-options "$(CFLAGS)" -c $< -o $@

obj: mkdir -p obj backup: mkdir -p backup results: mkdir -p results

.PHONY: clean

clean: rm -rf $(OBJS) $(EXEC) $(LIBNAMESO) $(APPNAMESO)

AlexeyAB commented 6 years ago

So with GPU=1 is now everything ok?

guoqiang01486 commented 6 years ago

GPU=1 is ok ! thank you

guo@guo-MS-7977:~$ nvidia-smi Thu Mar 29 12:11:35 2018
+-----------------------------------------------------------------------------+ | NVIDIA-SMI 384.111 Driver Version: 384.111 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 GeForce GTX 1080 Off | 00000000:01:00.0 On | N/A | | 80% 81C P2 181W / 240W | 3842MiB / 8110MiB | 98% Default | +-------------------------------+----------------------+----------------------+ | 1 GeForce GTX 1080 Off | 00000000:02:00.0 Off | N/A | | 0% 47C P8 10W / 240W | 11MiB / 8114MiB | 0% Default | +-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| | 0 1095 G /usr/lib/xorg/Xorg 278MiB | | 0 2620 G compiz 69MiB | | 0 11479 G ...-token=292277311D73A6A125AEEF42FE4B7265 88MiB | | 0 13854 C ./darknet 3402MiB | +-----------------------------------------------------------------------------+