Comments (7)
I am also curious about the layers to freeze, and I thought about some ways, like
- freezing the blocks with larger inputs, like En1 and En2,
- freezing all encoders
- freezing the first few Conv+BN+RELU layers for each block
- 2 plus 3
- 1 plus 3
Any idea about which is better for U-2-Net?
@Nathanua @PytaichukBohdan
from u-2-net.
I am also curious about the layers to freeze, and I thought about some ways, like
- freezing the blocks with larger inputs, like En1 and En2,
- freezing all encoders
- freezing the first few Conv+BN+RELU layers for each block
- 2 plus 3
- 1 plus 3
Any idea about which is better for U-2-Net?
@Nathanua @PytaichukBohdan
I've tried pretty much the same :)
But the results became blurry and hasn't come back to the original state.
Have you managed to get any progress?
from u-2-net.
I wasn't successful finetuning the smaller model on 200 images. It overfitted before delivering meaningful results.
Something that worked for me was to add my dataset to the DUTS TR dataset and train on that. My approach was as follows:
- Validate that my pipeline and the pretrained model lead to similar results on DUTS TE as reported in the paper.
- Validate that training for a few epochs using the DUTS TR data still leads to similar performance on DUTS TE.
- Train on DUTS TR + my dataset while watching the the performance on both DUTS TE and my own validation set.
That way you can be sure that the model improves on your task while still generalising to the DUTS dataset. All of this is of course only recommended if your task can be seen as some form of salient segmentation. Otherwise this will not work properly.
from u-2-net.
@pietz for how long did you train the model to produce results?
I tried combining my own dataset (200 or 3000 images of people) with DUTS TR. But after first epochs the result became worse and worse
from u-2-net.
@pietz for how long did you train the model to produce results?
I tried combining my own dataset (200 or 3000 images of people) with DUTS TR. But after first epochs the result became worse and worse
I used the smaller pretrained model, set the learning rate to 0.0001, increased batch size to 32 and trained for anywhere between 1 and 50 epochs. The results say roughly the same. Make sure your transformations match the original code. I used PyTorch transformations only instead of the custom functions in this repo.
from u-2-net.
I wasn't successful finetuning the smaller model on 200 images. It overfitted before delivering meaningful results.
Something that worked for me was to add my dataset to the DUTS TR dataset and train on that. My approach was as follows:
- Validate that my pipeline and the pretrained model lead to similar results on DUTS TE as reported in the paper.
- Validate that training for a few epochs using the DUTS TR data still leads to similar performance on DUTS TE.
- Train on DUTS TR + my dataset while watching the the performance on both DUTS TE and my own validation set.
That way you can be sure that the model improves on your task while still generalising to the DUTS dataset. All of this is of course only recommended if your task can be seen as some form of salient segmentation. Otherwise this will not work properly.
Great mind think alike. I am doing the same things as yours. However, when I validating the training(your second step) I've got MAE: 0.067 on DUTS TE for the model u2net instead of 0.044 from paper. I am not sure how the gap occurs. Any ideas?
from u-2-net.
I wasn't successful finetuning the smaller model on 200 images. It overfitted before delivering meaningful results.
Something that worked for me was to add my dataset to the DUTS TR dataset and train on that. My approach was as follows:
- Validate that my pipeline and the pretrained model lead to similar results on DUTS TE as reported in the paper.
- Validate that training for a few epochs using the DUTS TR data still leads to similar performance on DUTS TE.
- Train on DUTS TR + my dataset while watching the the performance on both DUTS TE and my own validation set.
That way you can be sure that the model improves on your task while still generalising to the DUTS dataset. All of this is of course only recommended if your task can be seen as some form of salient segmentation. Otherwise this will not work properly.
Great mind think alike. I am doing the same things as yours. However, when I validating the training(your second step) I've got MAE: 0.067 on DUTS TE for the model u2net instead of 0.044 from paper. I am not sure how the gap occurs. Any ideas?
Does the gap appear after training or aren't you able reproduce the results using the pretrained model?
If it's the latter there is something wrong with your code. I carefully reengineered the official code until I arrived at 0.054. I'm only using the smaller model.
If you see a gap after training, I'd try to start with an extremely small learning rate. Maybe training the larger model is less stable. SGD might be a better option than Adam for fine-tuning.
from u-2-net.
Related Issues (20)
- How can I input video or webcam in the test.py script?
- 能否麻烦将整个项目打个包(包含运行文件和预训练模型),集成一个 .bat 文件,点击运行即可使用? HOT 2
- 请问该模型只能输出二分类结果么?可以输出为多分类么?比如三分类 HOT 1
- Is it support person segmentation now? HOT 2
- 如何添加评价指标
- ImportError: cannot import name 'U2NET' from 'model' HOT 2
- Can' Access Human Segmentation Model Weights HOT 1
- Usage on cross platform mobile devices using tenser flow or pytourch ( Special on Flutter )
- 请问大家,我需要前景而非mask,该怎样修改代码呢,感谢
- /alueror: At least one stride in the given numpy aray is mepative, ad tensors with nepative strides are not curently suported. (You can probably work around this by making a copy of your array with array.copy( ).)
- u2net_train.py returning ValueError HOT 1
- the effect of replacing background with U-2-Net is not as expected, anyone can offer a help
- can tell me , label mask must be 0 or 1,if 0 or 1,why binary is smooth, if dataset mask edge in (0,1),it can work? HOT 1
- The results are not good when the object has small holes. HOT 1
- 有什么办法只保留抠图部分尺寸,不需要原图尺寸大小,谢谢 HOT 1
- num_workers=1
- u2net for semantic segmentation
- 自己数据训练的u2net,归一化尺寸320,但是抠图效果边缘锯齿明显
- Paddlehub is no longer under maintenance, what should I do if an error message is installed
- How can i use my own GPU to train
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 u-2-net.