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: negative dimensions are not allowed #55

Open
ljdhhhhh opened this issue May 10, 2024 · 5 comments
Open

ValueError: negative dimensions are not allowed #55

ljdhhhhh opened this issue May 10, 2024 · 5 comments

Comments

@ljdhhhhh
Copy link

When I run test.py, this error will appear at the end

20240510-161901

@lfxx
Copy link

lfxx commented May 11, 2024

When I run test.py, this error will appear at the end

20240510-161901

i get this error too.and i solve it by modify the test.py code refer to openpcdet

@LinearBasis
Copy link

You should figure out where your negative dimensions come from. I had a similar error; it turned out that the box type was not specified in the config, which is why the size was set to -1. Change the config type passed here (

def build_config(self, config_type):
) to the one you need

@zw-92
Copy link

zw-92 commented Sep 13, 2024

You should figure out where your negative dimensions come from. I had a similar error; it turned out that the box type was not specified in the config, which is why the size was set to -1. Change the config type passed here (

def build_config(self, config_type):

) to the one you need

Hello, may I ask where the specific configuration needs to be changed. thank.

@llz666ha
Copy link

Traceback (most recent call last):
File "test.py", line 203, in
main()
File "test.py", line 199, in main
eval_single_ckpt(model, test_loader, args, eval_output_dir, logger, epoch_id, dist_test=dist_test)
File "test.py", line 64, in eval_single_ckpt
eval_utils.eval_one_epoch(
File "/home/ubt-346/devdata1/llz/DetZero/detection/tools/eval_utils.py", line 141, in eval_one_epoch
result_str, result_dict = dataset.evaluation(
File "/home/ubt-346/devdata1/llz/DetZero/detection/detzero_det/datasets/waymo/waymo_dataset.py", line 126, in evaluation
ap_result_str, ap_dict = waymo_eval(eval_det_annos, eval_gt_annos)
File "/home/ubt-346/devdata1/llz/DetZero/detection/detzero_det/datasets/waymo/waymo_dataset.py", line 112, in waymo_eval
ap_dict = eval.waymo_evaluation(
File "/home/ubt-346/devdata1/llz/DetZero/detection/detzero_det/datasets/waymo/waymo_eval_detection.py", line 256, in waymo_evaluation
metrics = self.build_graph(graph, config_type)
File "/home/ubt-346/devdata1/llz/DetZero/detection/detzero_det/datasets/waymo/waymo_eval_detection.py", line 159, in build_graph
metrics = detection_metrics.get_detection_metric_ops(
File "/home/ubt-346/anaconda3/envs/detzero/lib/python3.8/site-packages/waymo_open_dataset/metrics/python/detection_metrics.py", line 154, in get_detection_metric_ops
variable_and_update_ops[name] = _update(name, update, init_shape, dtype)
File "/home/ubt-346/anaconda3/envs/detzero/lib/python3.8/site-packages/waymo_open_dataset/metrics/python/detection_metrics.py", line 40, in _update
v = tf.compat.v1.get_local_variable(
File "/home/ubt-346/anaconda3/envs/detzero/lib/python3.8/site-packages/tensorflow/python/ops/variable_scope.py", line 1727, in get_local_variable
return get_variable(
File "/home/ubt-346/anaconda3/envs/detzero/lib/python3.8/site-packages/tensorflow/python/ops/variable_scope.py", line 1579, in get_variable
return get_variable_scope().get_variable(
File "/home/ubt-346/anaconda3/envs/detzero/lib/python3.8/site-packages/tensorflow/python/ops/variable_scope.py", line 1322, in get_variable
return var_store.get_variable(
File "/home/ubt-346/anaconda3/envs/detzero/lib/python3.8/site-packages/tensorflow/python/ops/variable_scope.py", line 578, in get_variable
return _true_getter(
File "/home/ubt-346/anaconda3/envs/detzero/lib/python3.8/site-packages/tensorflow/python/ops/variable_scope.py", line 531, in _true_getter
return self._get_single_variable(
File "/home/ubt-346/anaconda3/envs/detzero/lib/python3.8/site-packages/tensorflow/python/ops/variable_scope.py", line 952, in _get_single_variable
v = variables.VariableV1(
File "/home/ubt-346/anaconda3/envs/detzero/lib/python3.8/site-packages/tensorflow/python/ops/variables.py", line 260, in call
return cls._variable_v1_call(*args, **kwargs)
File "/home/ubt-346/anaconda3/envs/detzero/lib/python3.8/site-packages/tensorflow/python/ops/variables.py", line 206, in _variable_v1_call
return previous_getter(
File "/home/ubt-346/anaconda3/envs/detzero/lib/python3.8/site-packages/tensorflow/python/ops/variables.py", line 199, in
previous_getter = lambda **kwargs: default_variable_creator(None, **kwargs)
File "/home/ubt-346/anaconda3/envs/detzero/lib/python3.8/site-packages/tensorflow/python/ops/variable_scope.py", line 2612, in default_variable_creator
return resource_variable_ops.ResourceVariable(
File "/home/ubt-346/anaconda3/envs/detzero/lib/python3.8/site-packages/tensorflow/python/ops/variables.py", line 264, in call
return super(VariableMetaclass, cls).call(*args, **kwargs)
File "/home/ubt-346/anaconda3/envs/detzero/lib/python3.8/site-packages/tensorflow/python/ops/resource_variable_ops.py", line 1584, in init
self._init_from_args(
File "/home/ubt-346/anaconda3/envs/detzero/lib/python3.8/site-packages/tensorflow/python/ops/resource_variable_ops.py", line 1722, in _init_from_args
initial_value = initial_value()
File "/home/ubt-346/anaconda3/envs/detzero/lib/python3.8/site-packages/waymo_open_dataset/metrics/python/detection_metrics.py", line 39, in
initializer = lambda: tf.constant([], shape=init_shape, dtype=dtype)
File "/home/ubt-346/anaconda3/envs/detzero/lib/python3.8/site-packages/tensorflow/python/framework/constant_op.py", line 264, in constant
return _constant_impl(value, dtype, shape, name, verify_shape=False,
File "/home/ubt-346/anaconda3/envs/detzero/lib/python3.8/site-packages/tensorflow/python/framework/constant_op.py", line 281, in _constant_impl
tensor_util.make_tensor_proto(
File "/home/ubt-346/anaconda3/envs/detzero/lib/python3.8/site-packages/tensorflow/python/framework/tensor_util.py", line 455, in make_tensor_proto
nparray = np.empty(shape, dtype=np_dt)
ValueError: negative dimensions are not allowed

Is this related to data sets? Instead of using the complete waymo dataset, I downloaded only part of v1.4.0, and then modified the contents of train.txt, val.txt, and text.txt. During the training, there was an error report of "AttributeError:'str 'object has no attribute' exists'". I solved it by modifying waymo_utils. At the test step, the error occurred again in the evaluation part.

@llz666ha
Copy link

When I use the pre training model:
Traceback (most recent call last):
File "test.py", line 203, in
main()
File "test.py", line 199, in main
eval_single_ckpt(model, test_loader, args, eval_output_dir, logger, epoch_id, dist_test=dist_test)
File "test.py", line 64, in eval_single_ckpt
eval_utils.eval_one_epoch(
File "/home/ubt-346/devdata1/llz/DetZero/detection/tools/eval_utils.py", line 141, in eval_one_epoch
result_str, result_dict = dataset.evaluation(
File "/home/ubt-346/devdata1/llz/DetZero/detection/detzero_det/datasets/waymo/waymo_dataset.py", line 126, in evaluation
ap_result_str, ap_dict = waymo_eval(eval_det_annos, eval_gt_annos)
File "/home/ubt-346/devdata1/llz/DetZero/detection/detzero_det/datasets/waymo/waymo_dataset.py", line 112, in waymo_eval
ap_dict = eval.waymo_evaluation(
File "/home/ubt-346/devdata1/llz/DetZero/detection/detzero_det/datasets/waymo/waymo_eval_detection.py", line 223, in waymo_evaluation
print(f"Prediction boxes3d min values: {pd_boxes3d.min(axis=0)}")
File "/home/ubt-346/anaconda3/envs/detzero/lib/python3.8/site-packages/numpy/core/_methods.py", line 43, in _amin
return umr_minimum(a, axis, None, out, keepdims, initial, where)
ValueError: zero-size array to reduction operation minimum which has no identity

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

5 participants