Giter Site home page Giter Site logo

chengchunhsu / everypixelmatters Goto Github PK

View Code? Open in Web Editor NEW
159.0 8.0 21.0 12.62 MB

Implementation of ECCV 2020 paper "Every Pixel Matters: Center-aware Feature Alignment for Domain Adaptive Object Detector"

License: Other

Dockerfile 0.58% Python 90.84% C++ 2.50% Cuda 5.00% Shell 0.43% C 0.65%
object-detection domain-adaptation transfer-learning adversarial-learning anchor-free fcos computer-vision pytorch eccv eccv2020

everypixelmatters's Introduction

Every Pixel Matters: Center-aware Feature Alignment for Domain Adaptive Object Detector

[Project Page] [PDF]

This project hosts the code for the implementation of Every Pixel Matters: Center-aware Feature Alignment for Domain Adaptive Object Detector (ECCV 2020).

Introduction

A domain adaptive object detector aims to adapt itself to unseen domains that may contain variations of object appearance, viewpoints or backgrounds. Most existing methods adopt feature alignment either on the image level or instance level. However, image-level alignment on global features may tangle foreground/background pixels at the same time, while instance-level alignment using proposals may suffer from the background noise.

Different from existing solutions, we propose a domain adaptation framework that accounts for each pixel via predicting pixel-wise objectness and centerness. Specifically, the proposed method carries out center-aware alignment by paying more attention to foreground pixels, hence achieving better adaptation across domains. To better align features across domains, we develop a center-aware alignment method that allows the alignment process.

We demonstrate our method on numerous adaptation settings with extensive experimental results and show favorable performance against existing state-of-the-art algorithms.

Installation

Check INSTALL.md for installation instructions.

The implementation of our anchor-free detector is heavily based on FCOS (#f0a9731).

Dataset

All details of dataset construction can be found in Sec 4.2 of our paper.

We construct the training and testing set by three following settings:

  • Cityscapes -> Foggy Cityscapes
    • Download Cityscapes and Foggy Cityscapes dataset from the link. Particularly, we use leftImg8bit_trainvaltest.zip for Cityscapes and leftImg8bit_trainvaltest_foggy.zip for Foggy Cityscapes.
    • Download and extract the converted annotation from the following links: Cityscapes and Foggy Cityscapes (COCO format).
    • Extract the training sets from leftImg8bit_trainvaltest.zip, then move the folder leftImg8bit/train/ to Cityscapes/leftImg8bit/ directory.
    • Extract the training and validation set from leftImg8bit_trainvaltest_foggy.zip, then move the folder leftImg8bit_foggy/train/ and leftImg8bit_foggy/val/ to Cityscapes/leftImg8bit_foggy/ directory.
  • Sim10k -> Cityscapes (class car only)
    • Download Sim10k dataset and Cityscapes dataset from the following links: Sim10k and Cityscapes. Particularly, we use repro_10k_images.tgz and repro_10k_annotations.tgz for Sim10k and leftImg8bit_trainvaltest.zip for Cityscapes.
    • Download and extract the converted annotation from the following links: Sim10k (VOC format) and Cityscapes (COCO format).
    • Extract the training set from repro_10k_images.tgz and repro_10k_annotations.tgz, then move all images under VOC2012/JPEGImages/ to Sim10k/JPEGImages/ directory and move all annotations under VOC2012/Annotations/ to Sim10k/Annotations/.
    • Extract the training and validation set from leftImg8bit_trainvaltest.zip, then move the folder leftImg8bit/train/ and leftImg8bit/val/ to Cityscapes/leftImg8bit/ directory.
  • KITTI -> Cityscapes (class car only)
    • Download KITTI dataset and Cityscapes dataset from the following links: KITTI and Cityscapes. Particularly, we use data_object_image_2.zip for KITTI and leftImg8bit_trainvaltest.zip for Cityscapes.
    • Download and extract the converted annotation from the following links: KITTI (VOC format) and Cityscapes (COCO format).
    • Extract the training set from data_object_image_2.zip, then move all images under training/image_2/ to KITTI/JPEGImages/ directory.
    • Extract the training and validation set from leftImg8bit_trainvaltest.zip, then move the folder leftImg8bit/train/ and leftImg8bit/val/ to Cityscapes/leftImg8bit/ directory.

After the preparation, the dataset should be stored as follows:

[DATASET_PATH]
└─ Cityscapes
   └─ cocoAnnotations
   └─ leftImg8bit
      └─ train
      └─ val
   └─ leftImg8bit_foggy
      └─ train
      └─ val
└─ KITTI
   └─ Annotations
   └─ ImageSets
   └─ JPEGImages
└─ Sim10k
   └─ Annotations
   └─ ImageSets
   └─ JPEGImages

Format and Path

Before training, please checked paths_catalog.py and enter the correct data path for:

  • DATA_DIR
  • cityscapes_train_cocostyle, cityscapes_foggy_train_cocostyle and cityscapes_foggy_val_cocostyle (for Cityscapes -> Foggy Cityscapes).
  • sim10k_trainval_caronly, cityscapes_train_caronly_cocostyle and cityscapes_val_caronly_cocostyle (for Sim10k -> Cityscapes).
  • kitti_train_caronly, cityscapes_train_caronly_cocostyle and cityscapes_val_caronly_cocostyle (for KITTI -> Cityscapes).

For example, if the datasets have been stored as the way we mentioned, the paths should be set as follows:

  • Dataset directory (In L8):

    DATA_DIR = [DATASET_PATH]
    
  • Train and validation set directory for each dataset:

    "cityscapes_train_cocostyle": {
        "img_dir": "Cityscapes/leftImg8bit/train",
        "ann_file": "Cityscapes/cocoAnnotations/cityscapes_train_cocostyle.json"
    },
    "cityscapes_train_caronly_cocostyle": {
        "img_dir": "Cityscapes/leftImg8bit/train",
        "ann_file": "Cityscapes/cocoAnnotations/cityscapes_train_caronly_cocostyle.json"
    },
    "cityscapes_val_caronly_cocostyle": {
        "img_dir": "Cityscapes/leftImg8bit/val",
        "ann_file": "Cityscapes/cocoAnnotations/cityscapes_val_caronly_cocostyle.json"
    },
    "cityscapes_foggy_train_cocostyle": {
        "img_dir": "Cityscapes/leftImg8bit_foggy/train",
        "ann_file": "Cityscapes/cocoAnnotations/cityscapes_foggy_train_cocostyle.json"
    },
    "cityscapes_foggy_val_cocostyle": {
        "img_dir": "Cityscapes/leftImg8bit_foggy/val",
        "ann_file": "Cityscapes/cocoAnnotations/cityscapes_foggy_val_cocostyle.json"
    },
    "sim10k_trainval_caronly": {
      "data_dir": "Sim10k",
        "split": "trainval10k_caronly"
    },
    "kitti_train_caronly": {
        "data_dir": "KITTI",
        "split": "train_caronly"
    },
    

(Optional) Format Conversion

If you want to construct the dataset and convert data format manually, here are some useful links:

Training

To reproduce our experimental result, we recommend training the model by following steps.

Let's take Cityscapes -> Foggy Cityscapes as an example.

1. Pre-training with only GA module

Run the bash files directly:

  • Using VGG-16 as backbone with 4 GPUs

    bash ./scripts/train_ga_vgg_cs.sh
    
  • Using ResNet-101 as backbone with 4 GPUs

    bash ./scripts/train_ga_resnet_cs.sh
    
  • (Optional) Using VGG-16 as backbone with single GPU

    bash ./scripts/single_gpu/train_ga_vgg_cs_single_gpu.sh
    

or type the bash commands:

  • Using VGG-16 as backbone with 4 GPUs

    python -m torch.distributed.launch \
        --nproc_per_node=4 \
        --master_port=$((RANDOM + 10000)) \
        tools/train_net_da.py \
        --config-file ./configs/da_ga_cityscapes_VGG_16_FPN_4x.yaml
    
  • Using ResNet-101 as backbone with 4 GPUs

    python -m torch.distributed.launch \
        --nproc_per_node=4 \
        --master_port=$((RANDOM + 10000)) \
        tools/train_net_da.py \
        --config-file ./configs/da_ga_cityscapes_R_101_FPN_4x.yaml
    
  • (Optional) Using VGG-16 as backbone with single GPU

    python tools/train_net_da.py \
        --config-file ./configs/da_ga_cityscapes_VGG_16_FPN_4x.yaml \
        SOLVER.MAX_ITER 80000 \
        SOLVER.IMS_PER_BATCH 4
    

2. Training with both GA and CA module

First, set the MODEL.WEIGHT as the path of pre-trained weight in L5 of the config file (example).

Next, the model can be trained by the following commands:

Run the bash files directly:

  • Using VGG-16 as backbone with 4 GPUs

    bash ./scripts/train_ga_ca_vgg_cs.sh
    
  • Using ResNet-101 as backbone with 4 GPUs

    bash ./scripts/train_ga_ca_resnet_cs.sh
    
  • (Optional) Using VGG-16 as backbone with single GPU

    bash ./scripts/single_gpu/train_ga_ca_vgg_cs_single_gpu.sh
    

or type the bash commands:

  • Using VGG-16 as backbone with 4 GPUs

    python -m torch.distributed.launch \
        --nproc_per_node=4 \
        --master_port=$((RANDOM + 10000)) \
        tools/train_net_da.py \
        --config-file ./configs/da_ga_ca_cityscapes_VGG_16_FPN_4x.yaml
    
  • Using ResNet-101 as backbone with 4 GPUs

    python -m torch.distributed.launch \
        --nproc_per_node=4 \
        --master_port=$((RANDOM + 10000)) \
        tools/train_net_da.py \
        --config-file ./configs/da_ga_ca_cityscapes_R_101_FPN_4x.yaml
    
  • (Optional) Using VGG-16 as backbone with single GPU

    python tools/train_net_da.py \
        --config-file ./configs/da_ga_ca_cityscapes_VGG_16_FPN_4x.yaml \
        SOLVER.MAX_ITER 80000 \
        SOLVER.IMS_PER_BATCH 4
    

Note that the optimizer and scheduler will not be loaded from the pre-trained weight in the default setting. You can set load_opt_sch as True in train_net_da.py to change the setting.

Evaluation

The trained model can be evaluated by the following command.

python tools/test_net.py \
	--config-file [CONFIG_PATH] \
	MODEL.WEIGHT [WEIGHT_PATH] \
	TEST.IMS_PER_BATCH 4
  • [CONFIG_PATH]: Path of config file
  • [WEIGHT_PATH]: Path of model weight for evaluation

For example, the following command evaluates the model weight vgg_cs.pth for Cityscapes -> Foggy Cityscapes using VGG-16 backbone.

python tools/test_net.py \
	--config-file configs/da_ga_ca_cityscapes_VGG_16_FPN_4x.yaml \
	MODEL.WEIGHT "vgg_cs.pth" \
	TEST.IMS_PER_BATCH 4

Note that the commands for evaluation are completely derived from FCOS (#f0a9731).

Please see here for more details.

Result

We provide the experimental results and model weights in this section.

Dataset Backbone mAP [email protected] [email protected] mAP@S mAP@M mAP@L Model Result
Cityscapes -> Foggy Cityscapes VGG-16 19.6 36.0 18.1 2.8 17.9 38.1 link link
Sim10k -> Cityscapes VGG-16 25.2 49.0 24.8 6.0 27.8 51.0 link link
KITTI -> Cityscapes VGG-16 18.2 44.3 10.8 6.2 22.0 37.1 link link

*Since the original model weight for KITTI dataset is inaccessible for now, we re-run the experiment and provide a similar (and even better) result in the table.

Note that we use 4 GPUs for faster training. For fair comparison, we also report the results using only one GPU.

Dataset Backbone mAP [email protected] [email protected] mAP@S mAP@M mAP@L Model Result
Sim10k -> Cityscapes VGG-16 28.2 49.7 27.8 6.3 30.6 57.0 link link

Environments

  • Hardware

    • 4 NVIDIA 1080 Ti GPUs
  • Software

    • PyTorch 1.3.0
    • Torchvision 0.2.1
    • CUDA 10.2

Citations

Please consider citing our paper in your publications if the project helps your research.

@inproceedings{hsu2020epm,
  title     = {Every Pixel Matters: Center-aware Feature Alignment for Domain Adaptive Object Detector},
  author    = {Cheng-Chun Hsu, Yi-Hsuan Tsai, Yen-Yu Lin, Ming-Hsuan Yang},
  booktitle = {European Conference on Computer Vision},
  year      = {2020}
}

everypixelmatters's People

Contributors

chengchunhsu avatar wasidennis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

everypixelmatters's Issues

Data annotation link is not available

Hi ! Thanks for your wonderful work
II tried to download the data to reproduce the results but it failed because the files do not exist or the links are no longer available. Could you update the link to the data annotation?
Thanks!

ValueError: bbox should have 2 dimensions, got 1

After loading model log contains information below. Can you please see what's the query?
It was running on actual dataset, but on custom data, it is producing this error. Thanks

loading annotations into memory...
Done (t=0.20s)
creating index...
index created!
2020-09-26 17:28:51,585 fcos_core.trainer INFO: Start training
Traceback (most recent call last):
File "tools/train_net_da.py", line 480, in
main()
File "tools/train_net_da.py", line 469, in main
model = train(cfg, args.local_rank, args.distributed)
File "tools/train_net_da.py", line 361, in train
arguments,
File "/home/akhtar/EveryPixelMatters/fcos_core/engine/trainer.py", line 128, in do_train
in enumerate(zip(data_loader_source, data_loader_target), start_iter):
File "/home/akhtar/epmatters/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 819, in next
return self._process_data(data)
File "/home/akhtar/epmatters/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 846, in _process_data
data.reraise()
File "/home/akhtar/epmatters/lib/python3.7/site-packages/torch/_utils.py", line 385, in reraise
raise self.exc_type(msg)
ValueError: Caught ValueError in DataLoader worker process 2.
Original Traceback (most recent call last):
File "/home/akhtar/epmatters/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop
data = fetcher.fetch(index)
File "/home/akhtar/epmatters/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/akhtar/epmatters/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/akhtar/EveryPixelMatters/fcos_core/data/datasets/sim10k.py", line 46, in getitem
target = self.get_groundtruth(index)
File "/home/akhtar/EveryPixelMatters/fcos_core/data/datasets/sim10k.py", line 65, in get_groundtruth
target = BoxList(anno["boxes"], (width, height), mode="xyxy")
File "/home/akhtar/EveryPixelMatters/fcos_core/structures/bounding_box.py", line 27, in init
"bbox should have 2 dimensions, got {}".format(bbox.ndimension())
ValueError: bbox should have 2 dimensions, got 1

I HAVE CHECKED SEVERAL TIMES THAT THERE IS NO EMPTY ANNOTATIONS

why does the 'atten_map' need another sigmoid ?

Hi, your work is great.

I wonder why does the atten_map need another sigmoid at this line?

atten_map = (self.center_aware_weight * box_cls_map * centerness_map).sigmoid()

In my view, the box_cls_map and centerness_map are the normalized score after sigmoid already, so
0<box_cls_map<1
0<centerness_map <1
, then,
0 < box_cls_map * centerness_map < 1,
0 <= center_aware_weight * box_cls_map * centerness_map < center_aware_weight
, so,
atten_map >= 0.5 forever.

If we set center_aware_weight to [0, 1], the
center_aware_weight * box_cls_map * centerness_map is also a normalized score,

then why does the atten_map need the sigmoid again?

reproducibility and domain classifier loss

Hello,
Thanks for providing the code. I was able to run the code for Sim10k --> Cityscapes and got scores lower than reported. mAP 24.8, mAP @0.5 42.6, mAP @0.75 24.4 , mAP @s 5.3 , mAP @m 27.3 , mAP@L 51.1 . One thing that I noticed is that the domain classifier loss goes down to zero for all the pyramid scales after few iterations. Could you please let me know what kind of trend you see for the domain classifier losses, which could possibly be the reason for me seeing the lower scores?

Thanks

dataset for foggy cityscapes

Hi, i have received the cityscapes dataset. However, when i click the link for foggy cityscapes, i don't know which one is i really need. In the website, i see some foggy cityscapes datasets for semantic segmentation, not for object detection. Can you give me the link for foggy dataset specifically. Thanks!

Confirmation of the step parameter in the config files

I notice the step parameters are set to be (120000, 160000) in most config files while the max_iter is 20,000. I am wondering should it be (12000, 16000) for the step parameters? Or the learning rate for the last iteration is better to equal to base_lr?
Thx!

AttributeError: 'list' object has no attribute 'resize'

Traceback (most recent call last):
File "C:/Users/84957/Desktop/qin/every/EveryPixelMatters-master/tools/train_net_da.py", line 480, in
main()
File "C:/Users/84957/Desktop/qin/every/EveryPixelMatters-master/tools/train_net_da.py", line 469, in main
model = train(cfg, args.local_rank, args.distributed)
File "C:/Users/84957/Desktop/qin/every/EveryPixelMatters-master/tools/train_net_da.py", line 361, in train
arguments,
File "C:\Users\84957\Desktop\qin\every\EveryPixelMatters-master\fcos_core\engine\trainer.py", line 128, in do_train
in enumerate(zip(data_loader_source, data_loader_target), start_iter):
File "D:\Anaconda\envs\TF2.1\lib\site-packages\torch\utils\data\dataloader.py", line 363, in next
data = self._next_data()
File "D:\Anaconda\envs\TF2.1\lib\site-packages\torch\utils\data\dataloader.py", line 989, in _next_data
return self._process_data(data)
File "D:\Anaconda\envs\TF2.1\lib\site-packages\torch\utils\data\dataloader.py", line 1014, in _process_data
data.reraise()
File "D:\Anaconda\envs\TF2.1\lib\site-packages\torch_utils.py", line 395, in reraise
raise self.exc_type(msg)
AttributeError: Caught AttributeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "D:\Anaconda\envs\TF2.1\lib\site-packages\torch\utils\data_utils\worker.py", line 185, in _worker_loop
data = fetcher.fetch(index)
File "D:\Anaconda\envs\TF2.1\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "D:\Anaconda\envs\TF2.1\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "C:\Users\84957\Desktop\qin\every\EveryPixelMatters-master\fcos_core\data\datasets\coco.py", line 67, in getitem
img, anno = super(COCODataset, self).getitem(idx)
File "D:\Anaconda\envs\TF2.1\lib\site-packages\torchvision\datasets\coco.py", line 118, in getitem
img, target = self.transforms(img, target)
File "C:\Users\84957\Desktop\qin\every\EveryPixelMatters-master\fcos_core\data\transforms\transforms.py", line 15, in call
image, target = t(image, target)
File "C:\Users\84957\Desktop\qin\every\EveryPixelMatters-master\fcos_core\data\transforms\transforms.py", line 60, in call
target = target.resize(image.size)
AttributeError: 'list' object has no attribute 'resize'

I trained according to the data set format you provided, but this error occurred. Does the annotation file need to be converted? Looking forward to your reply

Some questions of training schedule.

Thank you for your amazing work!!!

I have reproduced almost all your results about GA and CA in your papers. Actually, it is really hard to select the best models. I have to save a checkpoint every 250 iters following your configs and test them one by one with some tricks. On ResNet101, I can get 45 AP50 on Kitti, 40 AP50 on CS, and 51.5 AP50 on Sim10k. I am not sure if you select the model by testing a lot of candidates.

However, if I use the same configurations and same model-selection strategies to train a source-only model on pure FCOS, I can easily get 44 AP50 on Kitti, 27 AP50 on CS, and about 47 on Sim10k!! The results on CS seem normal. We have tested both on your codes and pure FCOS environments, achieving similar results. This really confused me a lot.

Therefore, could you please tell me how you train your source-only models? Are the configurations the same as adding DA? For example, the lR is set 0.005, the training iterations for Kitti are less, and report the best results selected from every 500/ 250 iterations with some handcraft tricks?

For example, if we choose the results from 1k iter to 5k iter for Kitti on FCOS, which is a similar iteration choice for DA, the AP50 can achieve 44. Do you train all these source-only models using COCO dataset schedules and report the results of the final models? Thank you so much!

some question about baseline

image
Did you use FPN to get the baseline results in the article?(without adapt baseline for example the line that AP50=25.6)

Fail to get the same results

Hi ! Thanks for your wonderful work ~But i fail to get as well as results in your paper. Can you post the ga results with VGG16 backbone in cityscape->foggy cityscape ?
GA:
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.174
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.331
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.157
Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.019
Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.156
Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.359
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.146
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.263
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.286
Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.052
Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.262
Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.560

GA_CA:
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.183
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.340
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.164
Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.023
Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.163
Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.370
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.149
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.280
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.302
Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.050
Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.279
Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.582

Data augmentation?

I have a general question/feature request about data augmentation. I've been manually adding in additional data augmentation (through the Albumentations package). Applying random photometric distortions (e.g. Gaussian blur, color jitter, etc.) significantly helps with the domain generalization. However, after I started adding random geometric distortions (e.g. random affine distortions), performance on the validation target domain decreased by about 5%, rather than improving, as I've observed in supervised learning. I'm fairly certain this isn't a bug, as I've checked and tested the various pipelines many times. I was wondering, do these types of augmentations mess up the discrimator fooling process? Or, is there anywhere I can find code that adds data augmentation to the fcos training routine?

Thank you!

Error: size mismatch when using the pretained model

I have downloaded both the sim10k and cityscapes datasets and tries to repeat the training process.

But when I use the following commond

python3 -m torch.distributed.launch --nproc_per_node=4 --master_port=$((RANDOM + 10000)) tools/train_net_da.py --config-file ./configs/da_ga_sim10k_VGG_16_FPN_4x.yaml

I have this error:

RuntimeError: Error(s) in loading state_dict for DistributedDataParallel:
size mismatch for module.fpn.fpn_inner3.weight: copying a param with shape torch.Size([256, 1024, 1, 1]) from checkpoint, the shape in current model is torch.Size([256, 256, 1, 1]).
size mismatch for module.fpn.fpn_inner4.weight: copying a param with shape torch.Size([256, 2048, 1, 1]) from checkpoint, the shape in current model is torch.Size([256, 512, 1, 1]).
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for DistributedDataParallel:
size mismatch for module.fpn.fpn_inner3.weight: copying a param with shape torch.Size([256, 1024, 1, 1]) from checkpoint, the shape in current model is torch.Size([256, 256, 1, 1]).
size mismatch for module.fpn.fpn_inner4.weight: copying a param with shape torch.Size([256, 2048, 1, 1]) from checkpoint, the shape in current model is torch.Size([256, 512, 1, 1]).

Can anyone give me any clue why this happens?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.