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.
6403 Discussions

Failed to convert yolo-v4-tiny-tf by converter.py

Mostafa-
Employee
1,080 Views

Hello All,

 

I followed the steps to download yolo-v4-tiny-tf from OMZ and convert it, but I got an error in conversion phase;

https://docs.openvino.ai/latest/omz_models_model_yolo_v4_tiny_tf.html

 

$ sudo python3 downloader.py --name yolo-v4-tiny-tf [done successfully]

$ python3 converter.py --name yolo-v4-tiny-tf [error message below]

Error Message:

None
Traceback (most recent call last):
File "/opt/intel/openvino_2021.4.752/deployment_tools/open_model_zoo/tools/downloader/public/yolo-v4-tiny-tf/keras-YOLOv3-model-set/tools/model_converter/convert.py", line 387, in <module>
_main(parser.parse_args())
File "/opt/intel/openvino_2021.4.752/deployment_tools/open_model_zoo/tools/downloader/public/yolo-v4-tiny-tf/keras-YOLOv3-model-set/tools/model_converter/convert.py", line 370, in _main
model.save('{}'.format(output_path))
File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/keras/engine/training.py", line 1996, in save
save.save_model(self, filepath, overwrite, include_optimizer, save_format,
File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/keras/saving/save.py", line 153, in save_model
hdf5_format.save_model_to_hdf5(
File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/keras/saving/hdf5_format.py", line 108, in save_model_to_hdf5
f = h5py.File(filepath, mode='w')
File "/usr/local/lib/python3.8/dist-packages/h5py/_hl/files.py", line 406, in __init__
fid = make_fid(name, mode, userblock_size,
File "/usr/local/lib/python3.8/dist-packages/h5py/_hl/files.py", line 179, in make_fid
fid = h5f.create(name, h5f.ACC_TRUNC, fapl=fapl, fcpl=fcpl)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py/h5f.pyx", line 108, in h5py.h5f.create
OSError: Unable to create file (unable to open file: name = '/opt/intel/openvino_2021.4.752/deployment_tools/open_model_zoo/tools/downloader/public/yolo-v4-tiny-tf/yolo-v4-tiny.h5', errno = 13, error message = 'Permission denied', flags = 13, o_flags = 242)
Traceback (most recent call last):
File "/opt/intel/openvino_2021.4.752/deployment_tools/open_model_zoo/models/public/yolo-v4-tiny-tf/pre-convert.py", line 46, in <module>
main()
File "/opt/intel/openvino_2021.4.752/deployment_tools/open_model_zoo/models/public/yolo-v4-tiny-tf/pre-convert.py", line 30, in main
subprocess.run([sys.executable, '--',
File "/usr/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/bin/python3', '--', '/opt/intel/openvino_2021.4.752/deployment_tools/open_model_zoo/tools/downloader/public/yolo-v4-tiny-tf/keras-YOLOv3-model-set/tools/model_converter/convert.py', '/opt/intel/openvino_2021.4.752/deployment_tools/open_model_zoo/tools/downloader/public/yolo-v4-tiny-tf/keras-YOLOv3-model-set/cfg/yolov4-tiny.cfg', '/opt/intel/openvino_2021.4.752/deployment_tools/open_model_zoo/tools/downloader/public/yolo-v4-tiny-tf/yolov4-tiny.weights', '/opt/intel/openvino_2021.4.752/deployment_tools/open_model_zoo/tools/downloader/public/yolo-v4-tiny-tf/yolo-v4-tiny.h5', '--yolo4_reorder']' returned non-zero exit status 1.

FAILED:
yolo-v4-tiny-tf

 

Many Thanks,

Mostafa

0 Kudos
1 Solution
IntelSupport
Moderator
1,054 Views

Hi Mostafa,

Thanks for reaching out.

I have successfully converted the yolo-v4-tiny-tf model using converter.py in Ubuntu 20.04 with Python 3.8 using the command below:

sudo python3 converter.py --name yolo-v4-tiny-tf --mo <INSTALL_DIR>/deployment_tools/model_optimizer/mo.py

ubuntu_yolo-v4-tiny-tf.jpg

 

Regards,

Aznie

 

View solution in original post

5 Replies
IntelSupport
Moderator
1,055 Views

Hi Mostafa,

Thanks for reaching out.

I have successfully converted the yolo-v4-tiny-tf model using converter.py in Ubuntu 20.04 with Python 3.8 using the command below:

sudo python3 converter.py --name yolo-v4-tiny-tf --mo <INSTALL_DIR>/deployment_tools/model_optimizer/mo.py

ubuntu_yolo-v4-tiny-tf.jpg

 

Regards,

Aznie

 

Mostafa-
Employee
1,004 Views

Many thanks Aznie, it converted now to IR files.

 

Can I change the input shape, please? so instead of data shape=(1, 3, 416, 416) it will be (1, 3, 416, 224)!

 

BR,

Mostafa

 

0 Kudos
Zulkifli_Intel
Moderator
983 Views

Hello Mostafa,

 

There is a feature called reshape that you can use. The reshape method is mentioned in the Usage of Reshape Method. Basically, reshape operation changes dimensions of the input tensor according to the specified order. Input tensor volume is equal to output tensor volume, where volume is the product of dimensions.


You can set a new input shape with the reshape() method. The InferenceEngine::CNNNetwork::reshape method updates input shapes and propagates them down to the outputs of the model through all intermediate layers.


The Shape Inference feature is used in Smart Classroom Demo. You may refer to this code.

 

Sincerely,

Zulkifli 


Mostafa-
Employee
958 Views

thanks a lot Zulkifi

0 Kudos
Zulkifli_Intel
Moderator
908 Views

Hello Mostafa,


Thank you for your question. If you need any additional information from Intel, please submit a new question as this thread is no longer being monitored.


Sincerely,

Zulkifli


0 Kudos
Reply