KevinDuarte / VideoCapsuleNet

Code for VideoCapsuleNet: A Simplified Network for Action Detection
59 stars 15 forks source link

TypeError: gather() got an unexpected keyword argument 'axis' #3

Open YAwei666 opened 5 years ago

YAwei666 commented 5 years ago

File "inference.py", line 13, in inference capsnet = Caps3d() File "/home/wyw/VideoCapsuleNet-master/caps_network.py", line 37, in init self.init_network() File "/home/wyw/VideoCapsuleNet-master/caps_network.py", line 129, in init_network padding='VALID', name='sec_caps', route_mean=True) File "/home/wyw/VideoCapsuleNet-master/caps_layers.py", line 348, in create_conv3d_caps d_gathered = tf.gather(u_padded, d_offsets, axis=1) TypeError: gather() got an unexpected keyword argument 'axis'

KevinDuarte commented 5 years ago

This might be an issue with the TensorFlow version you are using.

imagine5am commented 4 years ago

Replace gather with this function:

def gather_axis(params, indices, axis=0): return tf.stack(tf.unstack(tf.gather(tf.unstack(params, axis=axis), indices)), axis=axis)