hx173149 / C3D-tensorflow

C3D is a modified version of BVLC tensorflow to support 3D ConvNets.
MIT License
588 stars 262 forks source link

Couldn't run predict_c3d_ucf101.py #26

Closed zeynepgokce closed 7 years ago

zeynepgokce commented 7 years ago

I am new in this area. So, i need your help. The steps i followed : 1) i created dataset folder which has the UCF 101 videos but i opened just one folder with named "walk" under the dataset folder. And there are only 2 videos under this walk folder to test the model. The path is like this ../C3D-tensorflow-master/database/UCF101/walk 2) I followed the all steps on the README. the test.list file as following. /home/zeynep/Desktop/C3D-tensorflow-master/database/UCF101/walk/v_ApplyEyeMakeup_g01_c01 0 /home/zeynep/Desktop/C3D-tensorflow-master/database/UCF101/walk/v_ApplyEyeMakeup_g01_c02 1 3) Then i tried to run predict_c3d_ucf101.py code, i got the error as following.


Number of test videos=2
Traceback (most recent call last):
  File "predict_c3d_ucf101.py", line 154, in <module>
    tf.app.run()
  File "/home/zeynep/anaconda2/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "predict_c3d_ucf101.py", line 151, in main
    run_test()
  File "predict_c3d_ucf101.py", line 110, in run_test
    logits = tf.concat(0, logits)
  File "/home/zeynep/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 1043, in concat
    dtype=dtypes.int32).get_shape(
  File "/home/zeynep/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 676, in convert_to_tensor
    as_ref=False)
  File "/home/zeynep/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 741, in internal_convert_to_tensor
    ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
  File "/home/zeynep/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/constant_op.py", line 113, in _constant_tensor_conversion_function
    return constant(v, dtype=dtype, name=name)
  File "/home/zeynep/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/constant_op.py", line 102, in constant
    tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape, verify_shape=verify_shape))
  File "/home/zeynep/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/tensor_util.py", line 374, in make_tensor_proto
    _AssertCompatible(values, dtype)
  File "/home/zeynep/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/tensor_util.py", line 302, in _AssertCompatible
    (dtype.name, repr(mismatch), type(mismatch).__name__))
TypeError: Expected int32, got list containing Tensors of type '_Message' instead.

By the way, i installed the tensorflow with CPU not GPU. When i change the from gpu_num = 2 to gpu_num = 0 , the error like this

Number of test videos=2
Traceback (most recent call last):
  File "predict_c3d_ucf101.py", line 154, in <module>
    tf.app.run()
  File "/home/zeynep/anaconda2/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "predict_c3d_ucf101.py", line 151, in main
    run_test()
  File "predict_c3d_ucf101.py", line 110, in run_test
    logits = tf.concat(0, logits)
  File "/home/zeynep/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 1044, in concat
    ).assert_is_compatible_with(tensor_shape.scalar())
  File "/home/zeynep/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/tensor_shape.py", line 732, in assert_is_compatible_with
    raise ValueError("Shapes %s and %s are incompatible" % (self, other))
ValueError: Shapes (0,) and () are incompatible

What should i do to solve this problem and to got the result ?

segalinc commented 7 years ago

I found how to get around this error. Depending on your tf version, tf.concat has swapped the order of the arguments so it should be tf.concat(logits,0)

hx173149 commented 7 years ago

Yes, the @cristinasegalin is right, and the latest code has supported the TF 1.2 version now.