發表文章

目前顯示的是 1月, 2022的文章

Swin-Transformer-Object-Detection 訓練

以下是使用Swin Transformer Object Detection 訓練自己的資料集可能發生的問題 在single gpu 可能發生的問題: apex可能會無法正常運作,以cascade_mask_rcnn_swin_tiny_patch4_window7_mstrain_480-800_giou_4conv1f_adamw_1x_coco.py為例 須將runner = dict(type='EpochBasedRunnerAmp', max_epochs=12)修改為EpochBasedRunner 並且將 optimizer_config = dict(      type="DistOptimizerHook",      update_interval=1,      grad_clip=None,      coalesce=True,      bucket_size_mb=-1,      use_fp16=True,  ) comment起來 再來norm_cfg=dict(type='SyncBN', requires_grad=True),須將SyncBN替換為BN

Swin-Transformer-Object-Detection(mmdetection) 安裝

 conda create -n stod -y python=3.8 conda activate stod conda install pytorch=1.6.0 torchvision cudatoolkit=10.2 -c pytorch -y (可以替換自己需要的版本)   # mmcv安装 cd ~/software/ rm -rf mmcv git clone https://github.com/open-mmlab/mmcv.git cd mmcv MMCV_WITH_OPS=1 pip install -e . or pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html eg: pip install mmcv-full=1.4.6 -f https://download.openmmlab.com/mmcv/dist/cu113/torch1.10.0/index.html 實際版本參考網站:https://mmcv.readthedocs.io/en/latest/get_started/installation.html   # 安装apex git clone https://github.com/NVIDIA/apex cd apex pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./  可能會安裝失敗 可以試試:python setup.py install # mmdetection安装 git clone https://github.com/open-mmlab/mmdetection.git cd mmdetection pip install -r requirements/build.txt pip install -r requirements.txt pip install -v -e .  or pip install mm...