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

Detecting more than 2 digits #43

Open
lelmedda opened this issue Sep 8, 2020 · 7 comments
Open

Detecting more than 2 digits #43

lelmedda opened this issue Sep 8, 2020 · 7 comments

Comments

@lelmedda
Copy link

lelmedda commented Sep 8, 2020

Hi, I was wondering if this code can detect more than 2 digits per picture. I am training it with pictures with 4 digits, and it has only been detecting 2.

@penny4860
Copy link
Owner

I don't think training has been done properly. Can you show the detected image?

@lelmedda
Copy link
Author

The solution I have found for that so far is to divide the image in two parts each with 2 digits since 2 are detected easily.
im1
im2
TRENDnet TV-IP572W - 192_168_1_8-20190111-101135

@lelmedda
Copy link
Author

Do you know happen to remember what file I could use to print the digits that have been detected ?

@penny4860
Copy link
Owner

I didn't understand the question.

@lelmedda
Copy link
Author

I just want to save the detected digits to a database, but I am not sure in what file I should be adding the code for that. It's probably obvious, but I haven't worked with CNN before.

@Kamleshsam
Copy link

It creates various bounding boxes instead of 2 for 2 digit number . Is this happening for everyone?

@Laleh4
Copy link

Laleh4 commented Jan 25, 2022

Hi,
I have this problem, please !!
RuntimeError: The layer has never been called and thus has no defined output shape.
It happens in feature.py !!!!!!!

RuntimeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_1144/3722384473.py in
2
3 # 1. create yolo instance
----> 4 yolo_detector = create_yolo("ResNet50", ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], 416)

~\Documents\Pythons\test_yolo\Penny4860\Yolo-digit-detector\yolo\frontend.py in create_yolo(architecture, labels, input_size, anchors, coord_scale, class_scale, object_scale, no_object_scale)
33 n_classes = len(labels)
34 n_boxes = int(len(anchors)/2)
---> 35 yolo_network = create_yolo_network(architecture, input_size, n_classes, n_boxes)
36 yolo_loss = YoloLoss(yolo_network.get_grid_size(),
37 n_classes,

~\Documents\Pythons\test_yolo\Penny4860\Yolo-digit-detector\yolo\backend\network.py in create_yolo_network(architecture, input_size, nb_classes, nb_box)
14 nb_box):
15 feature_extractor = create_feature_extractor(architecture, input_size)
---> 16 yolo_net = YoloNetwork(feature_extractor,
17 input_size,
18 nb_classes,

~\Documents\Pythons\test_yolo\Penny4860\Yolo-digit-detector\yolo\backend\network.py in init(self, feature_extractor, input_size, nb_classes, nb_box)
30
31 # 1. create full network
---> 32 grid_size = feature_extractor.get_output_size()
33
34 # make the object detection layer

~\Documents\Pythons\test_yolo\Penny4860\Yolo-digit-detector\yolo\backend\utils\feature.py in get_output_size(self)
57
58 def get_output_size(self):
---> 59 output_shape = self.feature_extractor.get_output_shape_at(-1)
60 assert output_shape[1] == output_shape[2]
61 return output_shape[1]

~\AppData\Roaming\Python\Python38\site-packages\keras\engine\base_layer.py in get_output_shape_at(self, node_index)
1962 RuntimeError: If called in Eager mode.
1963 """
-> 1964 return self._get_node_attribute_at_index(node_index, 'output_shapes',
1965 'output shape')
1966

~\AppData\Roaming\Python\Python38\site-packages\keras\engine\base_layer.py in _get_node_attribute_at_index(self, node_index, attr, attr_name)
2558 """
2559 if not self._inbound_nodes:
-> 2560 raise RuntimeError('The layer has never been called '
2561 'and thus has no defined ' + attr_name + '.')
2562 if not len(self._inbound_nodes) > node_index:

RuntimeError: The layer has never been called and thus has no defined output shape.

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

4 participants