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

ValueError #9

Open
ghost opened this issue Oct 27, 2023 · 0 comments
Open

ValueError #9

ghost opened this issue Oct 27, 2023 · 0 comments

Comments

@ghost
Copy link

ghost commented Oct 27, 2023

ValueError Traceback (most recent call last)
Cell In[55], line 10
7 image_np = np.array(frame)
9 input_tensor = tf.convert_to_tensor(np.expand_dims(image_np, 0), dtype=tf.float32)
---> 10 detections = detect_fn(input_tensor)
12 num_detections = int(detections.pop('num_detections'))
13 detections = {key: value[0, :num_detections].numpy()
14 for key, value in detections.items()}

File ~\anaconda3\envs\anprtf\lib\site-packages\tensorflow\python\util\traceback_utils.py:153, in filter_traceback..error_handler(*args, **kwargs)
151 except Exception as e:
152 filtered_tb = _process_traceback_frames(e.traceback)
--> 153 raise e.with_traceback(filtered_tb) from None
154 finally:
155 del filtered_tb

File ~\anaconda3\envs\anprtf\lib\site-packages\tensorflow\python\framework\func_graph.py:1129, in func_graph_from_py_func..autograph_handler(*args, **kwargs)
1127 except Exception as e: # pylint:disable=broad-except
1128 if hasattr(e, "ag_error_metadata"):
-> 1129 raise e.ag_error_metadata.to_exception(e)
1130 else:
1131 raise

ValueError: in user code:

File "C:\Users\rites\AppData\Local\Temp\ipykernel_16796\1007919961.py", line 11, in detect_fn  *
    image, shapes = detection_model.preprocess(image)
File "C:\Users\rites\anaconda3\envs\anprtf\lib\site-packages\object_detection-0.1-py3.8.egg\object_detection\meta_architectures\ssd_meta_arch.py", line 485, in preprocess  *
    normalized_inputs, self._image_resizer_fn)
File "C:\Users\rites\anaconda3\envs\anprtf\lib\site-packages\object_detection-0.1-py3.8.egg\object_detection\utils\shape_utils.py", line 492, in resize_images_and_return_shapes  *
    outputs = static_or_dynamic_map_fn(
File "C:\Users\rites\anaconda3\envs\anprtf\lib\site-packages\object_detection-0.1-py3.8.egg\object_detection\utils\shape_utils.py", line 246, in static_or_dynamic_map_fn  *
    outputs = [fn(arg) for arg in tf.unstack(elems)]
File "C:\Users\rites\anaconda3\envs\anprtf\lib\site-packages\object_detection-0.1-py3.8.egg\object_detection\core\preprocessor.py", line 3330, in resize_image  *
    new_image = tf.image.resize_images(

ValueError: 'images' must have either 3 or 4 dimensions.
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

0 participants