squeezeDet icon indicating copy to clipboard operation
squeezeDet copied to clipboard

demo not accurate

Open twangnh opened this issue 7 years ago • 5 comments

Hi! with demo.py, it produce detections not accurate as the demo image you provided out_sample I use tf 1.4, do you have any idea? thanks

twangnh avatar Feb 05 '18 11:02 twangnh

Hi! I had the exact same issue yesterday and i solved it by retraining the network. It works properly now!

FrancescoFornasa avatar Apr 17 '18 09:04 FrancescoFornasa

@FrancescoFornasa - How many steps did it take for the network to converge and what was the batch size you used?

aditya1709 avatar Jun 14 '18 12:06 aditya1709

I have the same problem. And if I try squeezeDet+ I got:

Traceback (most recent call last):
  File "./src/demo.py", line 237, in <module>
    tf.app.run()
  File "/home/ubuntu/.local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 125, in run
    _sys.exit(main(argv))
  File "./src/demo.py", line 232, in main
    image_demo()
  File "./src/demo.py", line 184, in image_demo
    saver.restore(sess, FLAGS.checkpoint)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1752, in restore
    {self.saver_def.filename_tensor_name: save_path})
  File "/home/ubuntu/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 900, in run
    run_metadata_ptr)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1135, in _run
    feed_dict_tensor, options, run_metadata)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1316, in _do_run
    run_metadata)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1335, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [256] rhs shape= [384]
	 [[Node: save/Assign_4 = Assign[T=DT_FLOAT, _class=["loc:@fire10/expand1x1/biases"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:GPU:0"](fire10/expand1x1/biases, save/RestoreV2/_9)]]

Caused by op u'save/Assign_4', defined at:
  File "./src/demo.py", line 237, in <module>
    tf.app.run()
  File "/home/ubuntu/.local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 125, in run
    _sys.exit(main(argv))
  File "./src/demo.py", line 232, in main
    image_demo()
  File "./src/demo.py", line 181, in image_demo
    saver = tf.train.Saver(model.model_params)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1284, in __init__
    self.build()
  File "/home/ubuntu/.local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1296, in build
    self._build(self._filename, build_save=True, build_restore=True)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1333, in _build
    build_save=build_save, build_restore=build_restore)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 781, in _build_internal
    restore_sequentially, reshape)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 422, in _AddRestoreOps
    assign_ops.append(saveable.restore(saveable_tensors, shapes))
  File "/home/ubuntu/.local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 113, in restore
    self.op.get_shape().is_fully_defined())
  File "/home/ubuntu/.local/lib/python2.7/site-packages/tensorflow/python/ops/state_ops.py", line 219, in assign
    validate_shape=validate_shape)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/tensorflow/python/ops/gen_state_ops.py", line 60, in assign
    use_locking=use_locking, name=name)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
    op_def=op_def)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 3414, in create_op
    op_def=op_def)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1740, in __init__
    self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access

InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [256] rhs shape= [384]
	 [[Node: save/Assign_4 = Assign[T=DT_FLOAT, _class=["loc:@fire10/expand1x1/biases"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:GPU:0"](fire10/expand1x1/biases, save/RestoreV2/_9)]]

While retraining is possible, I reckon that the pretrained models should be supposed to work properly...

kwea123 avatar Sep 21 '18 12:09 kwea123

I encountered exactly the same problem and it seemed rather odd also to me. I assumed that the pretrained model they provided would yield the expected output on the demo image.

cstamatiadis avatar Apr 11 '19 07:04 cstamatiadis

@twangnh and @FrancescoFornasa I have exactly same result. Have you overcome it? Have you met difficulties when retrained?

korabelnikov avatar Aug 30 '19 17:08 korabelnikov