Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert Scaled YoloV4 #39

Open
at1993 opened this issue Mar 25, 2021 · 13 comments
Open

Convert Scaled YoloV4 #39

at1993 opened this issue Mar 25, 2021 · 13 comments

Comments

@at1993
Copy link

at1993 commented Mar 25, 2021

Hi TNTWEN,

As an enhancement request. Will you be supporting Scaled Yolo V4? This will be nice thanks.

@TNTWEN
Copy link
Owner

TNTWEN commented Mar 26, 2021

@at1993
yolov4-csp
I have finished the adaptation of yolov4-csp,But the usage is very different from the previous one. I'll publish it in a new branch later.
And more models are also comming

@TNTWEN
Copy link
Owner

TNTWEN commented Mar 26, 2021

@at1993
https://github.com/TNTWEN/OpenVINO-YOLOV4/tree/ScaledYOLOv4

yolov4-csp AND yolov4x-mish have been uploaded

When darknet support yolov4-P5,yolov4-P6,yolov4-P7 ,i will also update them

@at1993
Copy link
Author

at1993 commented Mar 26, 2021

Awesome! Thanks.

@at1993
Copy link
Author

at1993 commented Mar 26, 2021

Hi TNTWEN, I got the following error when running the script

python "C:\Program Files (x86)\Intel\openvino_2021.3.394\deployment_tools\model_optimizer\mo.py" --input_model frozen_darknet_yolov4_model.pb --batch 1 --reverse_input_channels --output detector/yolo-v4/Conv_94/BiasAdd,detector/yolo-v4/Conv_104/BiasAdd,detector/yolo-v4/Conv_114/BiasAdd/

D:\Programming\Python\OpenVINO-YOLOV4-Scaled\yolov4-csp>python "C:\Program Files (x86)\Intel\openvino_2021.3.394\deployment_tools\model_optimizer\mo.py" --input_model frozen_darknet_yolov4_model.pb --batch 1 --reverse_input_channels --output detector/yolo-v4/Conv_94/BiasAdd,detector/yolo-v4/Conv_104/BiasAdd,detector/yolo-v4/Conv_114/BiasAdd/
Model Optimizer arguments:
Common parameters:
- Path to the Input Model: D:\Programming\Python\OpenVINO-YOLOV4-Scaled\yolov4-csp\frozen_darknet_yolov4_model.pb
- Path for generated IR: D:\Programming\Python\OpenVINO-YOLOV4-Scaled\yolov4-csp.
- IR output name: frozen_darknet_yolov4_model
- Log level: ERROR
- Batch: 1
- Input layers: Not specified, inherited from the model
- Output layers: detector/yolo-v4/Conv_94/BiasAdd,detector/yolo-v4/Conv_104/BiasAdd,detector/yolo-v4/Conv_114/BiasAdd/
- Input shapes: Not specified, inherited from the model
- Mean values: Not specified
- Scale values: Not specified
- Scale factor: Not specified
- Precision of IR: FP32
- Enable fusing: True
- Enable grouped convolutions fusing: True
- Move mean values to preprocess section: None
- Reverse input channels: True
TensorFlow specific parameters:
- Input model in text protobuf format: False
- Path to model dump for TensorBoard: None
- List of shared libraries with TensorFlow custom layers implementation: None
- Update the configuration file with input/output node names: None
- Use configuration file used to generate the model with Object Detection API: None
- Use the config file: None
- Inference Engine found in: C:\Program Files (x86)\Intel\openvino_2021\python\python3.6\openvino
Inference Engine version: 2.1.2021.3.0-2787-60059f2c755-releases/2021/3
Model Optimizer version: 2021.3.0-2787-60059f2c755-releases/2021/3
[ ERROR ] Exception occurred during running replacer "REPLACEMENT_ID" (<class 'extensions.front.user_data_repack.UserDataRepack'>): No node with name detector/yolo-v4/Conv_114/BiasAdd/

@TNTWEN
Copy link
Owner

TNTWEN commented Mar 26, 2021

python "C:\Program Files (x86)\Intel\openvino_2021.3.394\deployment_tools\model_optimizer\mo.py" --input_model frozen_darknet_yolov4_model.pb --batch 1 --reverse_input_channels --output detector/yolo-v4/Conv_94/BiasAdd,detector/yolo-v4/Conv_104/BiasAdd,detector/yolo-v4/Conv_114/BiasAdd/

you should delete the last /

@TNTWEN
Copy link
Owner

TNTWEN commented Mar 26, 2021

python "C:\Program Files (x86)\Intel\openvino_2021.3.394\deployment_tools\model_optimizer\mo.py" --input_model frozen_darknet_yolov4_model.pb --batch 1 --reverse_input_channels --output detector/yolo-v4/Conv_94/BiasAdd,detector/yolo-v4/Conv_104/BiasAdd,detector/yolo-v4/Conv_114/BiasAdd

This is correct

@at1993
Copy link
Author

at1993 commented Mar 26, 2021

Thanks, it works now. The python program is running OK, However, when I run it with the C++ object_detection_demo program, it returns an error.

\Documents\Intel\OpenVINO\omz_demos_build\intel64\Release>object_detection_demo -m "D:\Programming\Python\OpenVINO-YOLOV4-Scaled\yolov4-csp\frozen_darknet_yolov4_model.xml" -i "waikikibeach.mp4" -d GPU -at yolo
[ INFO ] InferenceEngine: API version ......... 2.1
Build ........... 2021.3.0-2787-60059f2c755-releases/2021/3
[ INFO ] Parsing input parameters
[ INFO ] Reading input
MFX: Can't initialize session
[ INFO ] Loading Inference Engine
[ INFO ] Device info:
[ INFO ] GPU
clDNNPlugin version ......... 2.1
Build ........... 2021.3.0-2787-60059f2c755-releases/2021/3
Loading network files
[ INFO ] Batch size is forced to 1.
[ INFO ] Checking that the inputs are as the demo expects
[ INFO ] Checking that the outputs are as the demo expects
[ ERROR ] Invalid output type: Add. RegionYolo expected

@TNTWEN
Copy link
Owner

TNTWEN commented Mar 26, 2021

This is the difference between Scaled-yolov4 and yolov4 . Model conversion and inference demo need special treatment.
So it is not compatible with openvino's official C + + demo

@at1993
Copy link
Author

at1993 commented Mar 26, 2021

Do you have any sample code in C++ for this "special treatment" as my library is written in C++? Would love to be able to run it in C++.

@TNTWEN
Copy link
Owner

TNTWEN commented Mar 26, 2021

I'm not familiar with C++ demo,but i will try

@at1993
Copy link
Author

at1993 commented Mar 26, 2021

Thank you.

@RohitKeshari
Copy link

Any one find any solution for openvino version of Scaled-yolov4?

@TNTWEN
Copy link
Owner

TNTWEN commented Apr 5, 2022

@RohitKeshari This repo already supports Scaled-yolov4
https://github.com/TNTWEN/OpenVINO-YOLOV4/tree/ScaledYOLOv4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants