pochih / Video-Cap

🎬 Video Captioning: ICCV '15 paper implementation
48 stars 20 forks source link

Training #1

Open Zumbalamambo opened 6 years ago

Zumbalamambo commented 6 years ago

how do I train in my own dataset?

pochih commented 6 years ago

You need to extract video features. Given a video, I slice it to 80 slices equally. Then feed 80 slices into VGG16 net, and extract the last fully connected layer's output. So the feature of a video will be a matrix with shape 80x4096.

sxs4337 commented 6 years ago

Thanks for the great code! Are there any scripts for video feature extraction and other pre-processing steps that can be shared? These would be very helpful in running the code on other datasets. Thanks in advance.

sxs4337 commented 6 years ago

I was able to create the npy files for train features. When I start the training, I get this error-

Traceback (most recent call last): File "python/train.py", line 288, in train() File "python/train.py", line 192, in train train_op = tf.train.AdamOptimizer(learning_rate).minimize(tf_loss) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/optimizer.py", line 325, in minimize name=name) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/optimizer.py", line 446, in apply_gradients self._create_slots([_get_variable_for(v) for v in var_list]) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/adam.py", line 122, in _create_slots self._zeros_slot(v, "m", self._name) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/optimizer.py", line 766, in _zeros_slot named_slots[_var_key(var)] = slot_creator.create_zeros_slot(var, op_name) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/slot_creator.py", line 174, in create_zeros_slot colocate_with_primary=colocate_with_primary) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/slot_creator.py", line 146, in create_slot_with_initializer dtype) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/slot_creator.py", line 66, in _create_slot_var validate_shape=validate_shape) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 1049, in get_variable use_resource=use_resource, custom_getter=custom_getter) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 948, in get_variable use_resource=use_resource, custom_getter=custom_getter) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 356, in get_variable validate_shape=validate_shape, use_resource=use_resource) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 341, in _true_getter use_resource=use_resource) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 671, in _get_single_variable "VarScope?" % name) ValueError: Variable Wemb/Adam/ does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=None in VarScope?

I am using Tensorflow version 1.1.0. There seems to be a workaround here- https://github.com/tensorflow/tensorflow/issues/6220

But I am unable to add to the train.py file. Any help is appreciated. Thanks.