LossNAN / I3D-Tensorflow

Train I3D model on ucf101 or hmdb51 by tensorflow
Apache License 2.0
112 stars 28 forks source link

IndexError: too many indices for array #18

Open ZealACMer opened 5 years ago

ZealACMer commented 5 years ago

image Can you tell me how to fix this problem, thank you very much.

ZealACMer commented 5 years ago

image I checked the tensor shape before execute " img = img[crop_x:crop_x + crop_size, crop_y:crop_y + crop_size, :]" line 164 in I3D-Tensorflow/input_data.py. How can a two-dimensional array pass its value to a three dimensional array. Thank you so much for your kind help.

ilkarman commented 5 years ago

You are missing the RGB channels, e.g. (256, 342, 3). If you have one channel then unsqueeze an extra dimension.

HyunWoo-Nick commented 4 years ago

i got same problem and I just modified it like this

img = img[crop_x:crop_x + crop_size, crop_y:crop_y + crop_size, : ] to img = img[crop_x:crop_x + crop_size, crop_y:crop_y + crop_size]

and now i got this error image

HyunWoo-Nick commented 4 years ago

i solved this

https://github.com/LossNAN/I3D-Tensorflow/blob/master/input_data.py#L164 img = img[crop_x:crop_x + crop_size, crop_y:crop_y + crop_size, : ] to img = img[crop_x:crop_x + crop_size, crop_y:crop_y + crop_size]

and also

https://github.com/LossNAN/I3D-Tensorflow/blob/master/input_data.py#L80 rgb_ret_arr, s_index = get_data(filename, num_frames_per_clip, sample_rate) to rgb_ret_arr, s_index = get_data(filename_i, num_frames_per_clip, sample_rate)