jiang-du / BlazePose-tensorflow

A third-party Tensorflow Implementation for paper "BlazePose: On-device Real-time Body Pose tracking".
Apache License 2.0
113 stars 24 forks source link

parts dividing at fine-tuning #8

Open s-kav opened 3 years ago

s-kav commented 3 years ago

Hello! I saw your great TF realization. I would be thank from your help. Now, I'm realizing the similar task for BlazePose model in TF, I want to add-learn this model additionally based on my new dataset in the specific area (make a fine-tuning), but I cannot understand to which layer I need to freeze the model. You have a freezing by "for layer in model.layers[0:16]" - so, it's a feature extractor (FE) in this range of layers, and in your case fine-tuning is started after FE by indicating a number of block (16). Thank you for your work. At the same time, I have find other implementation of this model with more number of blocks, and it confused me. What's differences between both models, why they both have different number of blocks ?

I'm using this model with pre-trained weights by this graph. Thus, I need a number of layer, from which I need to freeze a model. Could you help with these issues. Thank you in advance.

HongChow commented 3 years ago

Hello! I saw your great TF realization. I would be thank from your help. Now, I'm realizing the similar task for BlazePose model in TF, I want to add-learn this model additionally based on my new dataset in the specific area (make a fine-tuning), but I cannot understand to which layer I need to freeze the model. You have a freezing by "for layer in model.layers[0:16]" - so, it's a feature extractor (FE) in this range of layers, and in your case fine-tuning is started after FE by indicating a number of block (16). Thank you for your work. At the same time, I have find other implementation of this model with more number of blocks, and it confused me. What's differences between both models, why they both have different number of blocks ?

I'm using this model with pre-trained weights by this graph. Thus, I need a number of layer, from which I need to freeze a model. Could you help with these issues. Thank you in advance.

Would you please tell me if you could find some pytorch realization?

jiang-du commented 3 years ago

Thank you for your questions.

According to your description, your task was mainly to transfer BlazePose trained on the public dataset to your own dataset. Thus, your work of "pre-train" is based on a well-trained BlazePose model.

However, my description of "pre-train" and "fine-tune" in this repo makes a different sense. The "pre-train" in this repo was meant to train the heatmap branch, and "fine-tune" was meant to train the joint regression branch.

Back to your concern, my suggestion is that we could make this transfer learning according to the number of images in your dataset.

If your own dataset is even many times smaller than public dataset, you could try to run "pre-train" and "fine-tune" to train an optimal set of weights. Then, try to end-to-end train on your own dataset without freezing the layers.

If your dataset is large enough, I think it is a better idea to leave the training on public dataset with under-fitting. Then, two-step train of your own dataset.

The above stands for my opinion. I could not ensure it must works well. If my suggestion does not work, please feel free to correct me.

HongChow commented 3 years ago

Thank you for your questions.

According to your description, your task was mainly to transfer BlazePose trained on the public dataset to your own dataset. Thus, your work of "pre-train" is based on a well-trained BlazePose model.

However, my description of "pre-train" and "fine-tune" in this repo makes a different sense. The "pre-train" in this repo was meant to train the heatmap branch, and "fine-tune" was meant to train the joint regression branch.

Back to your concern, my suggestion is that we could make this transfer learning according to the number of images in your dataset.

If your own dataset is even many times smaller than public dataset, you could try to run "pre-train" and "fine-tune" to train an optimal set of weights. Then, try to end-to-end train on your own dataset without freezing the layers.

If your dataset is large enough, I think it is a better idea to leave the training on public dataset with under-fitting. Then, two-step train of your own dataset.

The above stands for my opinion. I could not ensure it must works well. If my suggestion does not work, please feel free to correct me.

hi , thank you for your grate work ... Do you know any pytorch version?

s-kav commented 3 years ago

Thank you for your questions.

According to your description, your task was mainly to transfer BlazePose trained on the public dataset to your own dataset. Thus, your work of "pre-train" is based on a well-trained BlazePose model.

However, my description of "pre-train" and "fine-tune" in this repo makes a different sense. The "pre-train" in this repo was meant to train the heatmap branch, and "fine-tune" was meant to train the joint regression branch.

Back to your concern, my suggestion is that we could make this transfer learning according to the number of images in your dataset.

If your own dataset is even many times smaller than public dataset, you could try to run "pre-train" and "fine-tune" to train an optimal set of weights. Then, try to end-to-end train on your own dataset without freezing the layers.

If your dataset is large enough, I think it is a better idea to leave the training on public dataset with under-fitting. Then, two-step train of your own dataset.

The above stands for my opinion. I could not ensure it must works well. If my suggestion does not work, please feel free to correct me.

Thanks for your answer. Now, my dataset has a volume more 10 000 images (based on an augmentation technique) in my specific area, and I know how I can increase its volume in the near few weeks, I think up to several tens of thousands. I need to re-train (additionally) the model, because an accuracy of the current model isn't enough good for my specific area. So, you have proposed don't freeze any layers and will start to re-train (additionally) this model with small learning rate, i.e. try to end-to-end train on my own dataset. Am I right?

s-kav commented 3 years ago

Hello! I saw your great TF realization. I would be thank from your help. Now, I'm realizing the similar task for BlazePose model in TF, I want to add-learn this model additionally based on my new dataset in the specific area (make a fine-tuning), but I cannot understand to which layer I need to freeze the model. You have a freezing by "for layer in model.layers[0:16]" - so, it's a feature extractor (FE) in this range of layers, and in your case fine-tuning is started after FE by indicating a number of block (16). Thank you for your work. At the same time, I have find other implementation of this model with more number of blocks, and it confused me. What's differences between both models, why they both have different number of blocks ? I'm using this model with pre-trained weights by this graph. Thus, I need a number of layer, from which I need to freeze a model. Could you help with these issues. Thank you in advance.

Would you please tell me if you could find some pytorch realization?

OK, I will inform you

s-kav commented 3 years ago

Thank you for your questions.

According to your description, your task was mainly to transfer BlazePose trained on the public dataset to your own dataset. Thus, your work of "pre-train" is based on a well-trained BlazePose model.

However, my description of "pre-train" and "fine-tune" in this repo makes a different sense. The "pre-train" in this repo was meant to train the heatmap branch, and "fine-tune" was meant to train the joint regression branch.

Back to your concern, my suggestion is that we could make this transfer learning according to the number of images in your dataset.

If your own dataset is even many times smaller than public dataset, you could try to run "pre-train" and "fine-tune" to train an optimal set of weights. Then, try to end-to-end train on your own dataset without freezing the layers.

If your dataset is large enough, I think it is a better idea to leave the training on public dataset with under-fitting. Then, two-step train of your own dataset.

The above stands for my opinion. I could not ensure it must works well. If my suggestion does not work, please feel free to correct me.

I propose to move our conversations to mail area. My email you can find in my git-repo.

jiang-du commented 3 years ago

Thank you for your questions. According to your description, your task was mainly to transfer BlazePose trained on the public dataset to your own dataset. Thus, your work of "pre-train" is based on a well-trained BlazePose model. However, my description of "pre-train" and "fine-tune" in this repo makes a different sense. The "pre-train" in this repo was meant to train the heatmap branch, and "fine-tune" was meant to train the joint regression branch. Back to your concern, my suggestion is that we could make this transfer learning according to the number of images in your dataset. If your own dataset is even many times smaller than public dataset, you could try to run "pre-train" and "fine-tune" to train an optimal set of weights. Then, try to end-to-end train on your own dataset without freezing the layers. If your dataset is large enough, I think it is a better idea to leave the training on public dataset with under-fitting. Then, two-step train of your own dataset. The above stands for my opinion. I could not ensure it must works well. If my suggestion does not work, please feel free to correct me.

Thanks for your answer. Now, my dataset has a volume more 10 000 images (based on an augmentation technique) in my specific area, and I know how I can increase its volume in the near few weeks, I think up to several tens of thousands. I need to re-train (additionally) the model, because an accuracy of the current model isn't enough good for my specific area. So, you have proposed don't freeze any layers and will start to re-train (additionally) this model with small learning rate, i.e. try to end-to-end train on my own dataset. Am I right?

Yes. If you have tried and that did not perform well, I think it is likely that we could pre-train on a larger dataset than LSP.

Similarly, I am also trying to transfer this network to my application. While, I even do not have labeled data for fine-tuning. I am also suffering from obviously poor performance till now.

jiang-du commented 3 years ago

Thank you for your questions. According to your description, your task was mainly to transfer BlazePose trained on the public dataset to your own dataset. Thus, your work of "pre-train" is based on a well-trained BlazePose model. However, my description of "pre-train" and "fine-tune" in this repo makes a different sense. The "pre-train" in this repo was meant to train the heatmap branch, and "fine-tune" was meant to train the joint regression branch. Back to your concern, my suggestion is that we could make this transfer learning according to the number of images in your dataset. If your own dataset is even many times smaller than public dataset, you could try to run "pre-train" and "fine-tune" to train an optimal set of weights. Then, try to end-to-end train on your own dataset without freezing the layers. If your dataset is large enough, I think it is a better idea to leave the training on public dataset with under-fitting. Then, two-step train of your own dataset. The above stands for my opinion. I could not ensure it must works well. If my suggestion does not work, please feel free to correct me.

I propose to move our conversations to mail area. My email you can find in my git-repo.

OK, I have sent you an email.

s-kav commented 3 years ago

Thank you for your questions. According to your description, your task was mainly to transfer BlazePose trained on the public dataset to your own dataset. Thus, your work of "pre-train" is based on a well-trained BlazePose model. However, my description of "pre-train" and "fine-tune" in this repo makes a different sense. The "pre-train" in this repo was meant to train the heatmap branch, and "fine-tune" was meant to train the joint regression branch. Back to your concern, my suggestion is that we could make this transfer learning according to the number of images in your dataset. If your own dataset is even many times smaller than public dataset, you could try to run "pre-train" and "fine-tune" to train an optimal set of weights. Then, try to end-to-end train on your own dataset without freezing the layers. If your dataset is large enough, I think it is a better idea to leave the training on public dataset with under-fitting. Then, two-step train of your own dataset. The above stands for my opinion. I could not ensure it must works well. If my suggestion does not work, please feel free to correct me.

I propose to move our conversations to mail area. My email you can find in my git-repo.

OK, I have sent you an email.

Hello, I hope you're fine. I have written some letters by email, but no answers from you.