Comments (9)
def adjust_learning_rate_poly(optimizer, iteration, max_iter):
"""Sets the learning rate
# Adapted from PyTorch Imagenet example:
# https://github.com/pytorch/examples/blob/master/imagenet/main.py
"""
lr = initial_lr * ( 1 - (iteration / max_iter)) * ( 1 - (iteration / max_iter))
if ( lr < 1.0e-7 ):
lr = 1.0e-7
return lr
learning_rate is not adjusted at all!
add these codes before return lr:
for param_group in optimizer.param_groups:
param_group['lr'] = lr
Maybe this can solve the problem
from libfacedetection.train.
def adjust_learning_rate_poly(optimizer, iteration, max_iter):
"""Sets the learning rateAdapted from PyTorch Imagenet example:
https://github.com/pytorch/examples/blob/master/imagenet/main.py
"""
lr = initial_lr * ( 1 - (iteration / max_iter)) * ( 1 - (iteration / max_iter))
if ( lr < 1.0e-7 ):
lr = 1.0e-7
return lrlearning_rate is not adjusted at all!
add these codes before return lr:
for param_group in optimizer.param_groups:
param_group['lr'] = lr
Maybe this can solve the problem
Thanks for pointing that out, I'll try that and post the new result later.
from libfacedetection.train.
After modifying the lr code, the final result with scales=[1.], confidence_threshold=0.3 is
Easy Val AP: 0.8285190221051939
Medium Val AP: 0.7929441126273071
Hard Val AP: 0.5663795815749137
from libfacedetection.train.
the learning rate is adapted according to epoches, not iterations
from libfacedetection.train.
the learning rate is adapted according to epoches, not iterations
After modifying the lr code, the final result with scales=[1.], confidence_threshold=0.3 is
Easy Val AP: 0.8285190221051939
Medium Val AP: 0.7929441126273071
Hard Val AP: 0.5663795815749137
If you increase batch size to 256, and then fine-tune the mode, you will get a better result.
from libfacedetection.train.
the learning rate is adapted according to epoches, not iterations
After modifying the lr code, the final result with scales=[1.], confidence_threshold=0.3 is
Easy Val AP: 0.8285190221051939
Medium Val AP: 0.7929441126273071
Hard Val AP: 0.5663795815749137If you increase batch size to 256, and then fine-tune the mode, you will get a better result.
Thank you for your guidance, I'll try it and post the new result. About fine-tune, does the initial lr need to be set to a smaller value?
from libfacedetection.train.
You can use the same lr, but start from the 200th epoch.
from libfacedetection.train.
You can use the same lr, but start from the 200th epoch.
Thank you so much for your guidence!
from libfacedetection.train.
After fine-tune, the new result is
Easy Val AP: 0.8321736396427939
Medium Val AP: 0.7988401596758341
Hard Val AP: 0.579757106591874
I see professor Yu update the new result yesterday. So even though my new result is better than the original score which is tested on the model without fine-tune, there still exist a huge differences in the final result between the fine-tune model I trained and the official fine-tune model.
I train the first edition model with batchsize 8 and 500 epochs, then use the final model to fine-tune with batch size 256 and start at epoch 200/500. I'm not sure which step was wrong,maybe the best way is to use pretrained model directly, LOL.
You can use the same lr, but start from the 200th epoch.
from libfacedetection.train.
Related Issues (20)
- 模型是否支持关键点输出 HOT 8
- 当转onnx的时候,验证pytorch模型推理和onnx推理时候出现问题 HOT 2
- Cannot download labelsv2 HOT 3
- nonsquare input size training and exporting HOT 1
- How to train with custom dataset by using the pretrained model? HOT 2
- where can we get datasets with key points to train Yunet?
- 最小像素点修改 HOT 1
- 图像预处理时的均值和方差为什么是[0,0,0]和[1,1,1] HOT 1
- 老师,如果在Win上配置了MMDET环境后,如何修改指令执行train.py呀? HOT 5
- Why can't I find the yunet_final.pth weight file HOT 2
- Did you try Focal loss, how about its performance ? HOT 1
- The problem has been solved
- Train on rotated images to improve landmarks. HOT 1
- pytrch2onnx convervsion issue HOT 2
- 训练完成导出C++部署不成功
- Problems installing the repo HOT 1
- Batch inference problem! HOT 1
- Not able to setup the training environment HOT 9
- 为啥数据不做归一化 HOT 1
- 带出onnx出错 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libfacedetection.train.