python convert_weights_to_mlmodel.py --img_size=416 --config_path=C:/Downloads/yolov4-tiny.cfg --weights_path=C:/Downloads/yolov4-tiny.weights --output_path=yolov4-tiny.mlmodel
Using TensorFlow backend.
Loading weights.
Weights Header: 0 2 5 [32012800]
Parsing Darknet config.
Creating Keras model.
Parsing section net_0
Parsing section convolutional_0
conv2d bn leaky (3, 3, 3, 32)
Traceback (most recent call last):
File "convert_weights_to_mlmodel.py", line 344, in
_main(parser.parse_args())
File "convert_weights_to_mlmodel.py", line 232, in _main
prev_layer = ZeroPadding2D(((1,0),(1,0)))(prev_layer)
File "C:\Miniconda3\envs\tf\lib\site-packages\keras\engine\base_layer.py", line 474, in call
output_shape = self.compute_output_shape(input_shape)
File "C:\Miniconda3\envs\tf\lib\site-packages\keras\layers\convolutional.py", line 2113, in compute_output_shape
output_shape[dim] += sum(padding_all_dims[dim])
TypeError: can only concatenate str (not "int") to str
I'm using tensorflow 1.5 and keras 2.2.4 (as other versions generated warnings of compatibility). It seems to have a type mixup somewhere in the code. Any ideas?
Hi,
I trying to convert yolov4 and yolov4-tiny (from https://github.com/AlexeyAB/darknet) but I got the same error for both of them:
python convert_weights_to_mlmodel.py --img_size=416 --config_path=C:/Downloads/yolov4-tiny.cfg --weights_path=C:/Downloads/yolov4-tiny.weights --output_path=yolov4-tiny.mlmodel Using TensorFlow backend. Loading weights. Weights Header: 0 2 5 [32012800] Parsing Darknet config. Creating Keras model. Parsing section net_0 Parsing section convolutional_0 conv2d bn leaky (3, 3, 3, 32) Traceback (most recent call last): File "convert_weights_to_mlmodel.py", line 344, in
_main(parser.parse_args())
File "convert_weights_to_mlmodel.py", line 232, in _main
prev_layer = ZeroPadding2D(((1,0),(1,0)))(prev_layer)
File "C:\Miniconda3\envs\tf\lib\site-packages\keras\engine\base_layer.py", line 474, in call
output_shape = self.compute_output_shape(input_shape)
File "C:\Miniconda3\envs\tf\lib\site-packages\keras\layers\convolutional.py", line 2113, in compute_output_shape
output_shape[dim] += sum(padding_all_dims[dim])
TypeError: can only concatenate str (not "int") to str
I'm using tensorflow 1.5 and keras 2.2.4 (as other versions generated warnings of compatibility). It seems to have a type mixup somewhere in the code. Any ideas?