Retrain DashCamNet model quit with problem saying "Cannot reshape..."

Hi All,

I followed the tutorial about retraining model, downloaded the dashcamnet model, prepared my tfrecords, and started the tlt-train command. But I got error saying “ValueError: Cannot reshape a tensor with 119808 elements to shape”

The log is as below:
Traceback (most recent call last):
File “/usr/local/bin/tlt-train-g1”, line 8, in
File “./common/”, line 47, in main
File “”, line 2, in main
File “./detectnet_v2/utilities/”, line 46, in wrapped_fn
File “./detectnet_v2/scripts/”, line 667, in main
File “./detectnet_v2/scripts/”, line 591, in run_experiment
File “./detectnet_v2/scripts/”, line 500, in train_gridbox
File “./detectnet_v2/scripts/”, line 353, in build_training_graph
File “./detectnet_v2/model/”, line 515, in build_training_graph
File “./detectnet_v2/model/”, line 261, in predictions_to_dict
File “./detectnet_v2/objectives/”, line 97, in reshape_output
File “/usr/local/lib/python2.7/dist-packages/keras/engine/”, line 457, in call
output =, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/keras/layers/”, line 401, in call
return K.reshape(inputs, (K.shape(inputs)[0],) + self.target_shape)
File “/usr/local/lib/python2.7/dist-packages/keras/backend/”, line 1969, in reshape
return tf.reshape(x, shape)
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/”, line 7179, in reshape
“Reshape”, tensor=tensor, shape=shape, name=name)
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/”, line 788, in _apply_op_helper
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/util/”, line 507, in new_func
return func(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/”, line 3300, in create_op
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/”, line 1823, in init
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/”, line 1662, in _create_c_op
raise ValueError(str(e))
ValueError: Cannot reshape a tensor with 119808 elements to shape [4,7,4,34,60] (228480 elements) for ‘reshape_1_1/Reshape’ (op: ‘Reshape’) with input shapes: [4,16,24,78], [5] and with input tensors computed as partial shapes: input[1] = [4,7,4,34,60].

Looks like it is a tensorflow related problem, but where to figure and fix it?


Hi hwang0273 ,
I am afraid this is the same topic as Error when retraining dashcamnet which is created by you.
Let’s sync in that topic. Thanks.