hx173149 / C3D-tensorflow

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

Pretrained model on sport1m #1

Closed vivoutlaw closed 8 years ago

vivoutlaw commented 8 years ago

Hi, do you have the pretrained model on the sport1m? Thanks! :)

hx173149 commented 8 years ago

@vivoutlaw I have a model file iterate from sport1m to my categories which is a binary classifier, and I can't share it to you because it belong my company's property. maybe next month when I am free I can convert the caffe's sport1m's C3D model to tensorflow version, and I will share it to you

dasabir commented 8 years ago

Hi I was also looking for any pretrained tensorflow model in C3D. Is there any progress on it?

vivoutlaw commented 8 years ago

@dasabir : Hey there is a pretrained model on the Sport1m dartaset on Keras. https://imatge.upc.edu/web/resources/c3d-model-keras-trained-over-sports-1m

dasabir commented 8 years ago

@vivoutlaw Thanks for the help. I will explore this (though I'm not familiar with Keras).

hx173149 commented 8 years ago

@vivoutlaw @dasabir hello I have transferred the sports1M model from caffe version to TF version, you can update the code and download the pretrained model from here: https://www.dropbox.com/sh/8wcjrcadx4r31ux/AAAkz3dQ706pPO8ZavrztRCca?dl=0

LiangXu123 commented 7 years ago

@vivoutlaw @hx173149 hello guys,sorry to bother you,but from the link https://www.dropbox.com/sh/8wcjrcadx4r31ux/AAAkz3dQ706pPO8ZavrztRCca?dl=0 i can only get the pre-train model on UCF101 which finetuning from sports1M,but how can i have the pretrained model on the pure sport1m pre-train model which has not finetuning on UCF101?

953585130 commented 6 years ago

@cc786537662 Hi, Have you solved this problem? I also want to train a new model with my own video data, but the author gives a fine-tuned sport1m, which I think is only for UCF.

LiangXu123 commented 6 years ago
default

look at this table at README,we provide different pre-trained model now!

953585130 commented 6 years ago

@cc786537662 Thank you for your reply! I have seen this table, I have downloaded all four pre-training documents. I just want to try the HMDB51 dataset (51 classes), the data is processed, and the training and fine-tuning are poor. Just getting into deep learning is not enough, there are still many confusions about fine tuning.

I started training with the HMDB51 dataset, and the pre-training model was replaced by conv3d_deepnetA_sport1m_iter_1900000_TF.model. But an error occurred: InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [51] rhs shape= [487] [[Node: save/Assign_10 = Assign[T=DT_FLOAT, _class=["loc:@var_name/bout"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0 /cpu:0"](var_name/bout, save/RestoreV2_10)]]

I know this is caused by a category mismatch. I don't know how to fine tune it? Can you give me some help? Thank you!

LiangXu123 commented 6 years ago

I think you can just restore some specific layers instead of all layers in your model, this will restore all layers in your checkpoint model:

saver = tf.train.Saver(tf.trainable_variables()) saver.restore(sess, modelpath + "sports1m_finetuning_ucf101.model")

you can skip some layers which will casue dimension mismatch like this:

var_list = [v for v in tf.trainable_variables() if v.name.find("conv") != -1] #this will only restore the conv layers saver = tf.train.Saver(var_list )

953585130 commented 6 years ago

@cc786537662 Sorry, I still have to bother you. I know that fine-tuning is to change the parameters in front of fc, fine-tuning fc and softmax. I tried to modify the code in train_c3d, sorry for the failure.

Create a saver for writing training checkpoints.

saver = tf.train.Saver(weights.values() + biases.values())
init = tf.global_variables_initializer()

# Create a session for running Ops on the Graph.
sess = tf.Session(
                config=tf.ConfigProto(allow_soft_placement=True)
                )
sess.run(init)
if os.path.isfile(model_filename) and use_pretrained_model:
  saver.restore(sess, model_filename)

How should I modify it?

KKkarthikK commented 5 years ago

@cc786537662 , @953585130, I have the same issue, I have taken 16 classes out of 101 in ucf data set. there is a class mismatch error like rhs has [4096,16 ]and lhs has [4096,101]. help me to slove this issue

LiangXu123 commented 5 years ago

just skip last layer when you restore the checkpoint, this is a basic tensorflow skill, you can google it.

leesky1c commented 5 years ago

@rockXL , Hello, bro. how do you convert a model from type in caffe to Tensorflow? For example, if I want to use the R2+1D pretrained model now, what should I do? By using the tools like mxdnn or anything else?