question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

kitti_multiloss.py generates ValueError: inputs must be a list of at least one Tensor with the same dtype and shape

See original GitHub issue

Hi Marvin,

I have gotten the the demo.py running successfully, and now I am trying to experimenting with train.py. However, I got the following error message

File “/home/ decoder/kitti_multiloss.py”, line 86, in loss name=‘reg_loss’) File “/devl /tensorflow/tf/lib/python3.4/site-packages/tensorflow/python/ops/math_ops.py”, line 1827, in add_n raise ValueError("inputs must be a list of at least one Tensor with the " ValueError: inputs must be a list of at least one Tensor with the same dtype and shape

It is caused by reg_loss_col = tf.GraphKeys.REGULARIZATION_LOSSES weight_loss = tf.add_n(tf.get_collection(reg_loss_col),name='reg_loss') in kitti_multiloss.py Are there any ways to print out the information of tf.get_collection(reg_loss_col) to figure out why the error was generated.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
MarvinTeichmanncommented, Apr 13, 2017

My suggestion should fix this. So I will close this for now.

0reactions
ishay2bcommented, Feb 2, 2018

While importing a new encoder into the project I encountered the same error. Registering a batch norm to REGULARIZATION_LOSSES collection resolved my issue.

self.conv_1_batch_norm = slim.batch_norm(self.conv_1, scope='conv_1/batch_norm') tf.add_to_collection(tf.GraphKeys.REGULARIZATION_LOSSES, self.conv_1_batch_norm)

Read more comments on GitHub >

github_iconTop Results From Across the Web

inputs must be a list of at least one Tensor with the same dtype ...
Command: python3 tf_cnn_benchmarks.py --batch_size=128 ... ValueError: inputs must be a list of at least one Tensor with the same dtype and ...
Read more >
regarding the ValueError: If `inputs` don't all have same shape ...
To see the type of an object in Python You can use the built-in function type . For example to see type of...
Read more >
tf.math.add_n | TensorFlow v2.11.0
Returns the element-wise sum of a list of tensors. ... All inputs in the list must have the same shape. ... b =...
Read more >
Introduction to PyTorch Tensors
Tensors are the central data abstraction in PyTorch. This interactive notebook provides an in-depth introduction to the torch.Tensor class.
Read more >
tensorflow.python.ops.control_flow_ops 源代码
if any(inp is None for inp in inputs): raise ValueError("At least one of the ... TensorShape) for s in flat_shapes): raise ValueError("`shapes` must...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found