Skip to content

Inference for yolov4-tiny-darknet is giving error #220

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

Open
Abhishek672 opened this issue Mar 7, 2022 · 2 comments
Open

Inference for yolov4-tiny-darknet is giving error #220

Abhishek672 opened this issue Mar 7, 2022 · 2 comments

Comments

@Abhishek672
Copy link

Hey @david8862,
Thanks for such amazing work.

I am having problem doing inference on yolov4tiny using yolo.py. I have converted .weights to .h5 and generated a anchors.txt file.
while running the snippet :

!python yolo.py --model_type=tiny_yolo4_darknet
--weights_path=weights/keras_darknet.h5
--anchors_path=weights/keras_darknet_anchors.txt
--classes_path=configs/classes.txt
--image
--input=img_0001.jpg
--output=result.jpg

I am getting error :
ValueError('This model type is not supported now')
Traceback (most recent call last):
File "yolo.py", line 91, in _generate_model
yolo_model, _ = get_yolo3_model(self.model_type, num_feature_layers, num_anchors, num_classes, input_shape=self.model_input_shape + (3,), model_pruning=self.pruning_model)
File "/content/keras-YOLOv3-model-set/yolo3/model.py", line 228, in get_yolo3_model
raise ValueError('This model type is not supported now')
ValueError: This model type is not supported now

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "yolo.py", line 437, in
main()
File "yolo.py", line 409, in main
yolo = YOLO_np(**vars(args))
File "yolo.py", line 69, in init
self.yolo_model = self._generate_model()
File "yolo.py", line 104, in _generate_model
assert yolo_model.layers[-1].output_shape[-1] ==
UnboundLocalError: local variable 'yolo_model' referenced before assignment.

Is this repository compatible with AlexyAB yolov4-tiny darknet?

Thanks

@david8862
Copy link
Owner

@Abhishek672 sorry I didn't involve tiny_yolo4_darknet model type in official process support. Maybe you can try validate_yolo.py for inference if you have been able to convert the darknet .cfg and .weights to Keras .h5

@Abhishek672
Copy link
Author

So @david8862,
If I choose yolov4-tiny with cspdarknet53 tiny as the backbone, It is not possible to do the training. Do you know any other repositories where this is implemented?

Thanks

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

2 participants