Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6503 Discussions

follow the tutorialUnable to import yolov4-darknet to tensorflow model

LimFang
Novice
2,002 Views

I have followed the instructions as stated in Tutorial Darknet* YOLOv4 Model — OpenVINO™ documentation — Version(latest) My yolov4.saved_model folder looks like this in the picture. When I try to upload the folder it takes way too much time and I keep getting this error after uploading 50%-70% of the folder: Can't retry wb.main.tasks.task.Task] args:(None, 'WaitModelUploadJob', 165) kwargs:{}

 

steps are as fllows:

LimFang_0-1654590609376.png

 

LimFang_1-1654590622885.png

 

 

 

 

 

0 Kudos
1 Solution
Hari_B_Intel
Moderator
1,763 Views

Hi LimFang 


For your information, DL Workbench has been updated to OpenVINO 2022.1 last week. 

you may use the latest OpenVINO 2022.1 to analyze your model.


Thank you


View solution in original post

0 Kudos
11 Replies
LimFang
Novice
1,988 Views

This is the convert.py .zip file

0 Kudos
LimFang
Novice
1,968 Views

This is my cfg file

0 Kudos
Wan_Intel
Moderator
1,942 Views

Hi LimFang,

Thanks for reaching out to us.

 

For your information, I encountered the same error as you. As a workaround, you can convert yolov4 model into Intermediate Representations with the following steps:

1.   Download a pretrained model file yolov4.weights from here.

2.   Git clone the converter repository with the following command:

 

 

git clone https://github.com/david8862/keras-YOLOv3-model-set.git

 

 

3.   Create a Virtual Environment:

 

 

python -m pip install virtualenv

python -m virtualenv venv

venv\Scripts\activate

 

 

4.   Install requirements

 

 

python -m pip install -r .\keras-YOLOv3-model-set\requirements.txt

 

 

5.   Convert Darknet Model to TensorFlow

 

 

python keras-YOLOv3-model-set\tools\model_converter\convert.py keras-YOLOv3-model-set\cfg\yolov4.cfg <path_to_weights_file>\yolov4.weights <output_dir>\yolov4.savedmodel --yolo4_reorder

 

 

convert darknet weight to tensorflow.JPG
6.
   Install the OpenVINO™ Development Tools Package

 

 

python -m pip install --upgrade pip

pip install openvino-dev[tensorflow2]

 

 

7.   Convert TensorFlow to Intermediate Representation:

 

 

mo --input_shape [1,608,608,3] --scale_values=image_input[255] --input=image_input --reverse_input_channels --saved_model_dir=yolov4.savedmodel

 

 

convert tensorflow to IR.JPG 

Hope it helps.

 

 

Regards,

Wan

 

0 Kudos
LimFang
Novice
1,935 Views

Hi ,thanks for your attention.

all things goes well and the .xml .bin files are successfully created.

However,when i upload these into dl workbench some errors occurred as follows;‘

LimFang_0-1654693372399.png

so what's wrong with it now? What does reader library path really means ?

 

Regards,

LimFang

0 Kudos
Wan_Intel
Moderator
1,922 Views

Hi LimFang,

May I know which version of the OpenVINO™ Deep Learning are you using?

 

You may check the version with the following command:

docker images

Capture.JPG 

 

 

Regards,

Wan

 

0 Kudos
LimFang
Novice
1,903 Views

Hi,Wan

Yeah it is as follows:

LimFang_0-1654767809562.png

Regards,

Lim fang

LimFang
Novice
1,895 Views

well i am using the dl workbench online launched in jupte lab, and i'm just tring to make this project worked only online.

As a result, I have not download a local dl workbench yet.

Sincerely,

LimFang

Wan_Intel
Moderator
1,876 Views

Hi LimFang,

I encountered the same error as you did when uploading the model that was generated from the OpenVINO Model Optimizer 2022.1 to DL Workbench in the Intel® DevCloud for the Edge (Python 3 OpenVINO 2022.1).
Capture.JPG

Let me check with the relevant team, and I will update you once I’ve obtained feedback from them. Meanwhile, could you please install openvino-dev 2021.4.2 and convert the model again? You can install openvino-dev 2021.4.2 and convert the model with the following command:

 

pip install openvino-dev==2021.4.2

mo --input_shape [1,608,608,3] --scale_values=image_input[255] --input=image_input --reverse_input_channels --saved_model_dir=yolov4.savedmodel

 

 

The model was able to upload to DL Workbench in the Intel® DevCloud for the Edge version Python 3 (OpenVINO 2021.4.2) as shown in the attachments below:

 

Selected Kernal for DL Workbench Launcher Python 3 (OpenVINO 2021.4.2):

Capture.JPG

 

Uploaded model that optimized using OpenVINO Model Optimizer version 2021.4.2.

Capture.JPG

 

 

Regards,

Wan

 

0 Kudos
LimFang
Novice
1,864 Views

HI Wan,

I will try all as you have mentioned, and I'd like to tell you the result as soon as it works.

 

Regards,

Lim Fang

Hari_B_Intel
Moderator
1,821 Views

Hi LimFang 


Apology for the late reply due to Devcloud being under maintenance for the last 1 week. 

After some investigation on the issue you are facing, we found that the DevCloud DL workbench currently does not support OpenVINO 2022.1 yet.


To fix the issue, my advice is to use OpenVINO 2021.4.2 and you should be able to Analyze your model. 


Hope this information helps


Thank you


0 Kudos
Hari_B_Intel
Moderator
1,764 Views

Hi LimFang 


For your information, DL Workbench has been updated to OpenVINO 2022.1 last week. 

you may use the latest OpenVINO 2022.1 to analyze your model.


Thank you


0 Kudos
Reply