-
Notifications
You must be signed in to change notification settings - Fork 36
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
ValueError: Python inputs incompatible with input_signature: #40
Comments
same problem did you find a soultion to it? |
The error appears because the input_tensor shape isn't being loaded correctly. You need to convert your image being loaded into the correct shape (1, None, None, 3). I made the following changes to fix it: This begins from line 122 of confusion_matrix_tf2.py
Note that, after this amendment, you will have to make another change in the draw function because the input_tensor no longer behaves as a numpy array. To solve this, simply add the following above line 239:
Hope this helps. Took me a while to figure out the root of the problem too. |
Thank you very much i created a fork with your fix and its now working ♥ |
I have done the way you have said. But I still face this error while generating the confusion matrix.. please do help me out too. |
how did you solve your problem please do help me too please. I am facing the same error |
I did follow the same code provided in the comment before me And you can check the fork (I think I edited something more to make it work) |
Checked again I did the same as the comment Did you change the code at the line two hundred? The np.array one ? |
Here is my complete code of confusion_matrix_tf2.csv from object_detection.metrics.tf_example_parser import BoundingBoxParser, StringParser, Int64Parser, FloatParser tf.compat.v1.flags.DEFINE_string('input_tfrecord_path', None, FLAGS = tf.compat.v1.flags.FLAGS class CustomParser(data_parser.DataToNumpyParser): def init(self): def parse(self, tf_example):
def compute_iou(groundtruth_box, detection_box):
def process_detections(input_dataset, model, categories, draw_option, draw_save_path):def process_detections(input_tfrecord_path, model, categories, draw_option, draw_save_path):
def display(confusion_matrix, categories, output_path):
def draw(image_name, image_path, image, categories, groundtruth_boxes, groundtruth_classes, detection_boxes, detection_classes, detection_scores):
def main(_):
if name == 'main': And here is my error Traceback (most recent call last): |
Can you explain that why my confusion matrix has shown 3 rows 3 columns. Although I have 2 classes. Confusion Matrix:
0 NORMAL ... 0.850427 [2 rows x 3 columns] |
It should show 2 row 2 col I don't know why the third one is there U can check your inputs it may have a third label or something (I don't really know 🥲) |
|
Can you please let me know how it has calculated precision and recall for separate class, like separate precision for normal class and separate precision for pneumonia class?? |
Do you mean the equation? Keep in mind I am not the creator of the script so I can't explain the code clearly But the equations can be explained in this picture |
ValueError: Python inputs incompatible with input_signature: inputs: ( [[[ 39 38 37 ... 36 36 36] [ 38 38 37 ... 36 36 36] [ 38 38 37 ... 36 36 36] ... [ 23 22 22 ... 163 158 155] [ 23 22 22 ... 157 153 151] [ 23 22 22 ... 155 153 152]]]) input_signature: ( TensorSpec(shape=(1, None, None, 3), dtype=tf.uint8, name='input_tensor'))
The text was updated successfully, but these errors were encountered: