Exception: RNN : Input dimension should be rank 3 : [batch_size, n_steps, n_features]
I am trying to test your model with my dataset but i am getting error in RNN:
........... ........... ........... [TL] RNNLayer Conv3D_ConvLSTM/clstm_layer_1: n_hidden:256 n_steps:16 in_dim:5 in_shape:(12, 16, 28, 28, 256) cell_fn:ConvLSTMCell Traceback (most recent call last): File "./testing_nvidia.py", line 36, in
networks = net.c3d_clstm(x, num_classes, False, False) File "/home/cvsion/Deeplearning/DeepTensorFlow/tensorlayer/c3d_clstm.py", line 86, in c3d_clstm name='clstm_layer_1') File "/home/cvsion/Deeplearning/DeepTensorFlow/tensorlayer/tensorlayer/layers.py", line 4537, in init raise Exception("RNN : Input dimension should be rank 3 : [batch_size, n_steps, n_features]") Exception: RNN : Input dimension should be rank 3 : [batch_size, n_steps, n_features]
I have create the dataset in the following format
/Video_data/TEST/class_01/subject13_r0/sk_color 138 0
/Video_data/TEST/class_01/subject13_r0/sk_color 154 0
/Video_data/TEST/class_01/subject13_r0/sk_color 170 0
/Video_data/TEST/class_01/subject13_r0/sk_color 186 0
/Video_data/TEST/class_02/subject13_r1/sk_color 132 1
/Video_data/TEST/class_02/subject13_r1/sk_color 148 1
/Video_data/TEST/class_02/subject13_r1/sk_color 164 1
/Video_data/TEST/class_02/subject13_r1/sk_color 180 1
/Video_data/TEST/class_03/subject14_r0/sk_color 120 2
/Video_data/TEST/class_03/subject14_r0/sk_color 136 2
/Video_data/TEST/class_03/subject14_r0/sk_color 152 2
/Video_data/TEST/class_03/subject14_r0/sk_color 168 2
/Video_data/TEST/class_04/subject14_r1/sk_color 117 3
/Video_data/TEST/class_04/subject14_r1/sk_color 133 3
/Video_data/TEST/class_04/subject14_r1/sk_color 149 3
/Video_data/TEST/class_04/subject14_r1/sk_color 165 3
so on...
In my each class sk_color folder has 80 images. Kindly let me know what wrong in my setup
@zhaiyuan any idea how to resolve above issue?? Thanks
@sainisanjay @GuangmingZhu Did you solve the problem? I also meet the problem. Can you give me some suggestion. Thank you very much!
Maybe it can be solved by this way. As the mentioned at the README.md, we should modify the source code of Tensorlay, we need to replace the RNNLayer code with the tensorlayer-rnnlayer.py. And It mostly solved. Then, there is also some error about version matching of tensorflow. My tensorflow version: 1.4.0 and Tensorlayer: 1.8
Dear @GuangmingZhu , I have modified the ...tensorlayer/layers/recurrent.py layer as per tensorlayer-rnnlayer.py. However, I am getting following errors, do you have any idea how to solve????
Traceback (most recent call last):
File "training_skig_rgb.py", line 48, in <module>
networks = net.c3d_clstm(x, num_classes, False, True)
File "..../C3Dtensorflow_CLSTM/c3d_clstm.py", line 86, in c3d_clstm
name='clstm_layer_1')
File "..../tensor/local/lib/python2.7/site-packages/tensorlayer/decorators/deprecated_alias.py", line 24, in wrapper
return f(*args, **kwargs)
File "..../tensor/local/lib/python2.7/site-packages/tensorlayer/layers/recurrent.py", line 236, in __init__
(cell_output, state) = cell(self.inputs[:, time_step, :], state)
File "..../C3Dtensorflow_CLSTM/ConvLSTMCell.py", line 72, in __call__
c, h = array_ops.split(3, 2, state)
File "..../tensor/local/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 1315, in split
axis=axis, num_split=num_or_size_splits, value=value, name=name)
File "..../tensor/local/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 7793, in split
"Split", split_dim=axis, value=value, num_split=num_split, name=name)
File "..../tensor/local/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 533, in _apply_op_helper
(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.
Dear @UpCoder , have you resolve your issues??? i am getting many errors as mentioned above comment. Do you have any idea about the errors???
@sainisanjay As far as I known, you need to replace the RNNLayer of TensorLayer Library with the tensorlayer-rnnlayer.py. It can be almost solved.
Dear @UpCoder , I have changed the RNNLayers code as per tensorlayer-rnnlayer.py but i am getting many errors as i have mentioned in my above comment.
Like: TypeError: Input 'split_dim' of 'Split' Op has type float32 that does not match expected type of int32.
I think you can google it, then you can find the answer in the first link. Google it
Maybe it can be solved by this way. As the mentioned at the README.md, we should modify the source code of Tensorlay, we need to replace the RNNLayer code with the tensorlayer-rnnlayer.py. And It mostly solved. Then, there is also some error about version matching of tensorflow.My tensorflow version: 1.4.0 and Tensorlayer: 1.8
TypeError: init() missing 1 required positional argument: 'prev_layer',this errors how to resolve???
@sainisanjay I use tensorflow(cpu)0.12,tensorlayers==1.8,and replace the RNNLayer of TensorLayer Library with the tensorlayer-rnnlayer.py.
@shajie17 i try to solve the problem using same code but i failed to do so. Later i modified the code with current release RNN layer code.
Dear @mynameiswh,Have you solved this problem? I have the same problem. How do you solve it?