AlexeyAB / darknet

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

Layer [yolo] not implemented (yolov3-tiny.cfg) #1510

Open leekwunfung817 opened 6 years ago

leekwunfung817 commented 6 years ago

I want to use my trained model in python, but not work. What happen? How to solve this problem? What is the best language and how to implement as the best?

Python:

from darkflow.net.build import TFNet
import cv2
import Z_folder_scann
import time

options = {"model": "cfg/yolov3-tiny.cfg", "load": "tiny-yolov3_51200.weights", "threshold": 0.1}
tfnet = TFNet(options)

Log:

C:\ProgramData\Anaconda3.5.2.0\python.exe C:/Users/leekw/PycharmProjects/cpos_darkflow_application/T_Car_positioning.py
C:\ProgramData\Anaconda3.5.2.0\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
C:\ProgramData\Anaconda3.5.2.0\lib\site-packages\darkflow\dark\darknet.py:54: UserWarning: ./cfg/yolov3-tiny.cfg not found, use D:\MachineLearning\darknet\alexey_darknet\darknet-master\build\darknet\x64\cfg\yolov3-tiny.cfg instead
D:\MachineLearning\darknet\alexey_darknet\darknet-master\build\darknet\x64\cpos\cfg\yolov3-tiny.cfg
  cfg_path, FLAGS.model))
D:\MachineLearning\darknet\alexey_darknet\darknet-master\build\darknet\x64\tiny-yolov3_51200.weights
Layer [yolo] not implemented
Parsing D:\MachineLearning\darknet\alexey_darknet\darknet-master\build\darknet\x64\cfg\yolov3-tiny.cfg
Process finished with exit code 1

I have [yolo] layer


[net]
# Testing
# batch=1
# subdivisions=1
# Training
batch=64
subdivisions=8
width=224
height=224
channels=3
momentum=0.9
decay=0.0005
angle=0
saturation = 1.5
exposure = 1.5
hue=.1

learning_rate=0.001
# burn_in=1000
max_batches = 500200
policy=steps
steps=400000,450000
scales=.1,.1

[convolutional]
batch_normalize=1
filters=16
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=32
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=64
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=128
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=1

[convolutional]
batch_normalize=1
filters=1024
size=3
stride=1
pad=1
activation=leaky

###########

[convolutional]
batch_normalize=1
filters=21
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=21
size=3
stride=1
pad=1
activation=leaky

[convolutional]
size=1
stride=1
pad=1
filters=21
activation=linear

[yolo]
mask = 3,4,5
anchors = 10,14,  23,27,  37,58,  81,82,  135,169,  344,319
classes=2
num=6
jitter=.3
ignore_thresh = .7
truth_thresh = 1
random=1

[route]
layers = -4

[convolutional]
batch_normalize=1
filters=21
size=1
stride=1
pad=1
activation=leaky

[upsample]
stride=2

[route]
layers = -1, 8

[convolutional]
batch_normalize=1
filters=21
size=3
stride=1
pad=1
activation=leaky

[convolutional]
size=1
stride=1
pad=1
filters=21
activation=linear

[yolo]
mask = 0,1,2
anchors = 10,14,  23,27,  37,58,  81,82,  135,169,  344,319
classes=2
num=6
jitter=.3
ignore_thresh = .7
truth_thresh = 1
random=1
leekwunfung817 commented 6 years ago

problem solved OpenCV are 3.4.0 is not support Yolov3 OpenCV are 3.4.3 are support Yolov3

Thanks for @AlexeyAB pull request to opencv/opencv