Error using image dataset of 640x360 for training using SqueezeDet.
muthiyanbhushan opened this issue · comments
Hello,
I changed the image size in src/config/kitty_squeezeDet_config.py file from to 640x360 for 96 classes and also added class names in the config.py file, keeping all other parameters same. I get error as:
Cannot find fire10/squeeze1x1 in the pretrained model. Use randomly initialized parameters
Cannot find fire10/expand1x1 in the pretrained model. Use randomly initialized parameters
Cannot find fire10/expand3x3 in the pretrained model. Use randomly initialized parameters
Cannot find fire11/squeeze1x1 in the pretrained model. Use randomly initialized parameters
Cannot find fire11/expand1x1 in the pretrained model. Use randomly initialized parameters
Cannot find fire11/expand3x3 in the pretrained model. Use randomly initialized parameters
Cannot find conv12 in the pretrained model. Use randomly initialized parameters
Traceback (most recent call last):
File "./src/train.py", line 359, in
tf.app.run()
File "/home/bhushan/anaconda3/envs/squeezedet/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 124, in run
_sys.exit(main(argv))
File "./src/train.py", line 355, in main
train()
File "./src/train.py", line 128, in train
model = SqueezeDet(mc)
File "/home/bhushan/squeezeDet/src/nets/squeezeDet.py", line 25, in init
self._add_interpretation_graph()
File "/home/bhushan/squeezeDet/src/nn_skeleton.py", line 159, in _add_interpretation_graph
name='pred_class_probs'
File "/home/bhushan/anaconda3/envs/squeezedet/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 3997, in reshape
"Reshape", tensor=tensor, shape=shape, name=name)
File "/home/bhushan/anaconda3/envs/squeezedet/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/home/bhushan/anaconda3/envs/squeezedet/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 3162, in create_op
compute_device=compute_device)
File "/home/bhushan/anaconda3/envs/squeezedet/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 3208, in _create_op_helper
set_shapes_for_outputs(op)
File "/home/bhushan/anaconda3/envs/squeezedet/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2427, in set_shapes_for_outputs
return _set_shapes_for_outputs(op)
File "/home/bhushan/anaconda3/envs/squeezedet/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2400, in _set_shapes_for_outputs
shapes = shape_func(op)
File "/home/bhushan/anaconda3/envs/squeezedet/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2330, in call_with_requiring
return call_cpp_shape_fn(op, require_shape_fn=True)
File "/home/bhushan/anaconda3/envs/squeezedet/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 627, in call_cpp_shape_fn
require_shape_fn)
File "/home/bhushan/anaconda3/envs/squeezedet/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 691, in _call_cpp_shape_fn_impl
raise ValueError(err.message)
ValueError: Cannot reshape a tensor with 207360 elements to shape [4,16848,96] (6469632 elements) for 'interpret_output/pred_class_probs' (op: 'Reshape') with input shapes: [2160,96], [3] and with input tensors computed as partial shapes: input[1] = [4,16848,96].
Do I need to change any more parameters?
Thanks.
you need to ensure that the dimensions / grid_indices = 16 .. if this ratio is violated, this error above occurs..
check the authors original code and you would find that the ImgHeight/Anchor_grid_height = 16
Hello @amanmeetgarg,
In which file will I get this information?
Thanks.
squeezeDet/src/config/kitti_squeezeDet_config.py
@amanmeetgarg Thanks.
I was able to train it.
Glad was of help.
All the best.
Hello @amanmeetgarg,
I am trying to run the model for 100000 steps.
The model checkpoint saved has 3 files.
- model.ckpt-99999.data-00000-of-00001
- model.ckpt-99999.index
- model.ckpt-99999.meta
But the final checkpoint value is not being stored like original checkpoint "model.ckpt-87000".
Can you please let me know how can I get this final weights?
Thanks.
Read the documentation from tensorflow
another reasonable source
https://blog.metaflow.fr/tensorflow-how-to-freeze-a-model-and-serve-it-with-a-python-api-d4f3596b3adc