thtrieu / darkflow

Translate darknet to tensorflow. Load trained weights, retrain/fine-tune using tensorflow, export constant graph def to mobile devices
GNU General Public License v3.0
6.13k stars 2.09k forks source link

What's wrong with Darkflow? #1206

Closed jangjh45 closed 2 years ago

jangjh45 commented 2 years ago

The cpu is enabled and the gpu is giving an error. What's wrong? cuda = 9.0 , cudnn = 7.0, tensorflow version=1.10.0

(dk4) C:\Users\jangj\anaconda3\envs\dk4\darkflow>python flow --model cfg/yolo.cfg --load bin/yolov2.weights --demo car.mp4 --gpu 0.5 --saveVideo C:\Users\jangj\anaconda3\envs\dk4\lib\site-packages\tensorflow\python\framework\dtypes.py:523: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint8 = np.dtype([("qint8", np.int8, 1)]) C:\Users\jangj\anaconda3\envs\dk4\lib\site-packages\tensorflow\python\framework\dtypes.py:524: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) C:\Users\jangj\anaconda3\envs\dk4\lib\site-packages\tensorflow\python\framework\dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint16 = np.dtype([("qint16", np.int16, 1)]) C:\Users\jangj\anaconda3\envs\dk4\lib\site-packages\tensorflow\python\framework\dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) C:\Users\jangj\anaconda3\envs\dk4\lib\site-packages\tensorflow\python\framework\dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint32 = np.dtype([("qint32", np.int32, 1)]) C:\Users\jangj\anaconda3\envs\dk4\lib\site-packages\tensorflow\python\framework\dtypes.py:532: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. np_resource = np.dtype([("resource", np.ubyte, 1)])

C:\Users\jangj\anaconda3\envs\dk4\darkflow\darkflow\dark\darknet.py:54: UserWarning: ./cfg/yolov2.cfg not found, use cfg/yolo.cfg instead cfg_path, FLAGS.model)) Parsing cfg/yolo.cfg Loading bin/yolov2.weights ... Successfully identified 203934260 bytes Finished in 0.028399229049682617s Model has a coco model name, loading coco labels.

Building net ... Source | Train? | Layer description | Output size -------+--------+----------------------------------+--------------- | | input | (?, 608, 608, 3) Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 608, 608, 32) Load | Yep! | maxp 2x2p0_2 | (?, 304, 304, 32) Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 304, 304, 64) Load | Yep! | maxp 2x2p0_2 | (?, 152, 152, 64) Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 152, 152, 128) Load | Yep! | conv 1x1p0_1 +bnorm leaky | (?, 152, 152, 64) Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 152, 152, 128) Load | Yep! | maxp 2x2p0_2 | (?, 76, 76, 128) Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 76, 76, 256) Load | Yep! | conv 1x1p0_1 +bnorm leaky | (?, 76, 76, 128) Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 76, 76, 256) Load | Yep! | maxp 2x2p0_2 | (?, 38, 38, 256) Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 38, 38, 512) Load | Yep! | conv 1x1p0_1 +bnorm leaky | (?, 38, 38, 256) Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 38, 38, 512) Load | Yep! | conv 1x1p0_1 +bnorm leaky | (?, 38, 38, 256) Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 38, 38, 512) Load | Yep! | maxp 2x2p0_2 | (?, 19, 19, 512) Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 19, 19, 1024) Load | Yep! | conv 1x1p0_1 +bnorm leaky | (?, 19, 19, 512) Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 19, 19, 1024) Load | Yep! | conv 1x1p0_1 +bnorm leaky | (?, 19, 19, 512) Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 19, 19, 1024) Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 19, 19, 1024) Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 19, 19, 1024) Load | Yep! | concat [16] | (?, 38, 38, 512) Load | Yep! | conv 1x1p0_1 +bnorm leaky | (?, 38, 38, 64) Load | Yep! | local flatten 2x2 | (?, 19, 19, 256) Load | Yep! | concat [27, 24] | (?, 19, 19, 1280) Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 19, 19, 1024) Load | Yep! | conv 1x1p0_1 linear | (?, 19, 19, 425) -------+--------+----------------------------------+--------------- GPU mode with 0.5 usage 2022-02-17 13:30:47.345429: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2 2022-02-17 13:30:47.441770: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1405] Found device 0 with properties: name: NVIDIA GeForce RTX 3070 major: 8 minor: 6 memoryClockRate(GHz): 1.77 pciBusID: 0000:01:00.0 totalMemory: 8.00GiB freeMemory: 6.96GiB 2022-02-17 13:30:47.441897: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1484] Adding visible gpu devices: 0 2022-02-17 13:33:51.750295: I tensorflow/core/common_runtime/gpu/gpu_device.cc:965] Device interconnect StreamExecutor with strength 1 edge matrix: 2022-02-17 13:33:51.750442: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971] 0 2022-02-17 13:33:51.750929: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] 0: N 2022-02-17 13:33:51.751303: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1097] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 4095 MB memory) -> physical GPU (device: 0, name: NVIDIA GeForce RTX 3070, pci bus id: 0000:01:00.0, compute capability: 8.6) Finished in 189.59724688529968s

Press [ESC] to quit demo Traceback (most recent call last): File "flow", line 6, in cliHandler(sys.argv) File "C:\Users\jangj\anaconda3\envs\dk4\darkflow\darkflow\cli.py", line 29, in cliHandler tfnet.camera() File "C:\Users\jangj\anaconda3\envs\dk4\darkflow\darkflow\net\help.py", line 130, in camera single_out, img, False) File "C:\Users\jangj\anaconda3\envs\dk4\darkflow\darkflow\net\yolov2\predict.py", line 45, in postprocess boxResults = self.process_box(b, h, w, threshold) File "C:\Users\jangj\anaconda3\envs\dk4\darkflow\darkflow\net\yolo\predict.py", line 28, in process_box left = int ((b.x - b.w/2.) * w) OverflowError: cannot convert float infinity to integer### ###