Comments (14)
Excuse me, where did you randomly sample k instances in your code?
from fsce.
(1)For a K-shot task, we can only get K instances of novel classes for training or finetune. If there are two 'chair' in a image, but we only need 1 shot. We will randomly choose one of them instead of both of them.
(2)Sampling k instances randomly should be done before training, you can run "prepare_[coco,voc,lvis]_few_shot.py" file in "FSCE/datasets/" to generate random k instances. After that, you should change your yaml to figure out which training dataset will be used.
from fsce.
Thanks for your reply. I run prepare_voc_few_shot.py and find there are more instances than the pre-defined k. For example, in "http://dl.yf.io/fs-det/datasets/vocsplit/seed1/box_10shot_sheep_train.txt", there are seven images while these images contain 24 'sheep' instances.
from fsce.
In 'http://dl.yf.io/fs-det/datasets/vocsplit/seed1/box_5shot_tvmonitor_train.txt', there are four images while these images contain six 'tvmonitor' instances. Maybe there is some important information that I have overlooked or I have a wrong understanding of these generated files. Look forward to your reply.
from fsce.
ucbdrive/few-shot-object-detection#89
Though a single process load exact k
shot, since the seed is not fixed over different rank, different processes may select different k
shot which results the overall shot is higher than the expected k
.
from fsce.
Thanks, “Is this expected behavior or a bug?”
from fsce.
I think it's expected behavior. When you run train_net, you should see a chart, which will tell you the number of instances from every class.
from fsce.
where can I find the configs file in the model_zoo ,as it is a soft link in the source file
from fsce.
@john2020-210 It's the output of the build operation. Please delete it, or the build operation may not succeed.
from fsce.
@Chauncy-Cai Thank you for your reply
from fsce.
Thanks for your reply. I run prepare_voc_few_shot.py and find there are more instances than the pre-defined k. For example, in "http://dl.yf.io/fs-det/datasets/vocsplit/seed1/box_10shot_sheep_train.txt", there are seven images while these images contain 24 'sheep' instances.
@Chen-Song The K-shot preparation comes from fsdet. We inspected the instances and have same concern with you. I also noticed fsdet dataloader load 1 instance per image, and ignoring all other annotations. Maybe that's their definition of "few-shot object detection". And actually, we are working on improving the sampling for K-shot, and change the data loader in our v2.
Too much details to discuss here. E.g., what to do when you already have 9-shot, and you sample an image with 4 sheeps.
Or, what to do with the novel instances during base training. I found in the base training stage, the "base images" even contains more (ignored) novel instances than base instances, because common class like person is novel and are so universal.
We encourage you to do your own research, and formulate your own K-shot sampling schema.
from fsce.
@bsun0802 I think it is a bug. If we fix seed before random choice, see here:
In DDP training different processes may select different instances though the number of instances of a single process is exact K. This is unfair when comparing other method which use exact K shot for training.
If we fix the seed, say np.random.seed(seed)
before random_choice
, then each process will select exactly the same instances and the number of overall instances is exact K. The performance will drop a lot.
from fsce.
This code is from fsdet unchanged.
I have a different understanding than yours @Retiina . And I don't think the problem you mention exists, based on my experience. Here is mine:
In my understanding and experience with detectron2, meta_pascal_voc.py
is used for registering the dataset. Which is executed on 1 cpu and executed only once for any training job, before any model training (DDP) code. This step register which exact K-shot to be used as the training data. And the actual data loader is in the function build_detection_train_loader
.
from fsce.
@bsun0802 Thanks for your reply. I think you are right.
from fsce.
Related Issues (20)
- Is there a requirements document here? HOT 3
- 结果是否为多次实验取平均
- GPU: 3090, I can't install cuda10 0, how can I compile it? HOT 2
- prepare dataset error HOT 6
- python setup.py build develop HOT 13
- 1 shot and 2 shot do not use contrastive loss?
- I can not get the same results in split 1 and shot 10? I just have one gpu 3090. HOT 4
- Train on myself dataset
- AssertionError: Box regression deltas become infinite or NaN! HOT 2
- --opts KeyError: 'Non-existent config key: MODEL.WETGHTS'
- Hello~Where should this code be added?
- I have not found where requirements.txt is.
- I only have a V100 32G ,could realize this model?
- How long does the training step take?
- Where is the requirements.txt? HOT 1
- 我想知道fine tune的时候terminal会显示cl loss的变化吗(I want to know if the terminal will display the change of cl loss during fine-tuning)
- 我想知道fine tune的时候terminal会显示cl loss的变化吗(I want to know if the terminal will display the change of cl loss during fine-tuning)
- question about contrastive loss HOT 1
- do we need to change the max_iter according to the number of the shots?
- pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI 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 fsce.