ssd_tensorflow icon indicating copy to clipboard operation
ssd_tensorflow copied to clipboard

Runtime error: type mismatch in vgg/ssd_base.py (float32 vs int32)

Open CorvusCorax opened this issue 7 years ago • 4 comments

I tried to run this both on the desktop and on a Jetson TX1, tensorflow 0.12.1 as well as 1.0a0 (both compiled form source)

I get a type mismatch error when running trainer.py in

npy file loaded
build model started
Traceback (most recent call last):
  File "trainer.py", line 407, in <module>
    start_train()
  File "trainer.py", line 236, in start_train
    ssd = SSD()
  File "trainer.py", line 32, in __init__
    self.imgs_ph, self.bn, self.output_tensors, self.pred_labels, self.pred_locs = model.model(self.sess)
  File "/home/raven/src/ssd_tensorflow/model.py", line 13, in model
    vgg.build(images)
  File "/home/raven/src/ssd_tensorflow/vgg/ssd_base.py", line 35, in build
    red, green, blue = tf.split(3, 3, rgb_scaled)
  File "/home/raven/.local/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 1222, in split
    split_dim=axis, num_split=num_or_size_splits, value=value, name=name)
  File "/home/raven/.local/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 3426, in _split
    num_split=num_split, name=name)
  File "/home/raven/.local/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 509, in apply_op
    (prefix, dtypes.as_dtype(input_arg.type).name))
TypeError: Input 'split_dim' of 'Split' Op has type float32 that does not match expected type of int32.


CorvusCorax avatar Jan 25 '17 11:01 CorvusCorax

I also met this problem.Did you slove it? Thanks! @CorvusCorax

chenweiqian avatar Feb 08 '17 20:02 chenweiqian

unfortunately not. I had to backbench this issue for now. I have near zero experience with tensorflow, so my personal workaround was to run caffe instead ;)

I was hoping @seann999 could help with this.

CorvusCorax avatar Feb 09 '17 17:02 CorvusCorax

@CorvusCorax today I sloved it. replace tf.split(3, 3, rgb_scaled) with tf.split(rgb_scaled, 3, 3) .

chenweiqian avatar Feb 10 '17 02:02 chenweiqian

tf.split in tensorflow 1.0 version has been changed,
so replace tf.split(3, 3, rgb_scaled) with tf.split(rgb_scaled, 3, 3) .

hjptriplebee avatar May 18 '17 03:05 hjptriplebee