강의

멘토링

로드맵

[改訂版] ディープラーニング・コンピュータビジョン完全ガイド

本講義は、Object DetectionとSegmentationに関する深い理論解説と、現場ですぐに活用できるレベルの実習例を通じて、皆様を現場で必要とされるディープラーニングベースのコンピュータビジョン専門家へと成長させます。

難易度 中級以上

受講期間 無制限

Python
Python
Machine Learning(ML)
Machine Learning(ML)
Deep Learning(DL)
Deep Learning(DL)
Computer Vision(CV)
Computer Vision(CV)
Python
Python
Machine Learning(ML)
Machine Learning(ML)
Deep Learning(DL)
Deep Learning(DL)
Computer Vision(CV)
Computer Vision(CV)

mmdetectionを使用してtrain_detectorを実行したときのエラー発生の解決方法

こんにちは、

 

mmdetection パッケージの最近の変更により train_detector(model, datasets, cfg, distributed=False, validate=True) を実行すると、 'ConfigDict' object has no attribute 'device' などのエラーが発生しています。

 

この問題はhttps://github.com/open-mmlab/mmdetection/issues/7901で確認できます。

 

回避策は、config設定に以下のようにcfg.device = 'cuda'を追加してください。

 

たとえば、練習コードのcfg設定で、以下のように最後にcfg.device = 'cuda'を追加してください。

 

その内容が Bug なのか、それとも意図的なものなのかは分からないので、一度は github にある実習コードは修正しません。

 

1週間ほど見守った後に問題がまだ発生する場合は、githubにある実習コードを修正後にお知らせします。

 

ありがとうございます。

 

# dataset の環境パラメータの変更。

cfg.dataset_type = 'PetDataset'

cfg.data_root = '/content/data/'

 

# train、val、test dataset の type、data_root、ann_file、img_prefix 環境パラメータの変更。

cfg.data.train.type = 'PetDataset'

cfg.data.train.data_root = '/content/data/'

cfg.data.train.ann_file = 'train.txt'

cfg.data.train.img_prefix = 'images'

 

..... その他の設定設定

 

# 'ConfigDict' object has no attribute 'device' エラーを防ぐための設定。

cfg.device='cuda'

コメント