Comments (1)
非常に重要なご質問をありがとうございます。
また、丁寧に丁寧に本書や他論文などを読み込んでのご質問を賜り、
誠にありがとうございます。
【1】hszhao氏のリポジトリsemsegのmodelでは、
https://github.com/hszhao/semseg/blob/master/model/pspnet.py#L52
および、L57を見ると、
self.layer3とself.layer4(私のfeature_dilated_res_1,2に相当)の
strideは1に上書き設定されております。
【2】chainerのpspnetにおいても
https://github.com/chainer/chainercv/blob/v0.13.1/chainercv/experimental/links/model/pspnet/pspnet.py#L103
およびL106を見ると、
self.res4とself.res5(私のfeature_dilated_res_1,2に相当)
もstrideは1になっております。
【3】hszhao氏のリポジトリsemsegのmodelでは、
最初に、
https://github.com/hszhao/semseg/blob/master/model/pspnet.py#L48
にて、
self.layer1, self.layer2, self.layer3, self.layer4 = resnet.layer1, resnet.layer2, resnet.layer3, resnet.layer4
として、resnetのlayer3,4を与えています。
これらのresnetのlayersは、torchvisionの公式モデルであり、
https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py#L149
および、L151の通り、
strideが2となっています(通常のResNet)。
hszhao氏は、PSPNetで使用する際に、この通常ResNetをロードしてから
https://github.com/hszhao/semseg/blob/master/model/pspnet.py#L52
を再掲するように、
self.layer3とself.layer4のstrideなどを上書きし、loadした通常ResNetから構成を変更しています。
その変更後が本書のモデル構成であり、stride=1となっていることに対応します。
【4】最後に念のため、
https://github.com/hszhao/PSPNet
のpspnet50_ADE20K.caffemodelを、単純にPyTorchモデルに変更した、
本書p.134記載の学習済みモデル(pspnet50_ADE20K.pth)を、
feature_dilated_res_1, feature_dilated_res_2をstride=2に変更したモデルに対して、ロードしてみたのですが、元のpspnet50_ADE20K.caffemodeモデルがstride=1なので、stride=1に更新変更されてしまいます。
やはり、stride=1でhszhao氏らは作成していると、彼らの学習済みモデルからも推察されます。
【結論】
@atsushi-tmdu さまのおっしゃる通り、通常のResNetにおいては、
feature_dilated_res_1, feature_dilated_res_2のstrideは2ですが、
PSPNetで使用する際にはstride=1に変更して実装されている、と私は考えております。
そのため本書もそう構成されております。
from pytorch_advanced.
Related Issues (20)
- 第2章 画像内の検出される物体数がゼロの場合の処理について HOT 4
- EfficientGANの実装について HOT 4
- 2-2-3においてのエラーについて HOT 3
- 【著者より】発刊から約3年、本書を今後どうしていくべきなのでしょうか。。。 HOT 3
- 第7章&第8章 本書のファイルを変更せずローカル実行できるDockerイメージ HOT 4
- P.82 DBox P.87 正規化 P.106 正解BBox その他 HOT 1
- 2-2-3 Datasetの実装(p.74上部)についての質問 HOT 5
- 2-2-3 p.78中部に関して HOT 2
- 3-7 p174 ファインチューニングによる学習と検証の実施(semantic segmentation) の損失の表示について HOT 1
- 2-4 ネットワークモデルの実装
- 2-4 ネットワークモデルの構築に関して
- 2-8 推論の実施で画像が描出されない
- 2-8 学習データをC++から使いたい
- 1-3転移学習のエラーについて
- semantic segmentationのIoUについて
- 【第1章】【1-1_load_vgg.ipynb】module 'matplotlib.pyplot' has no attribute 'open'
- AWSのEC2インスタンスに関して
- 2-2-3のDataTransformの動作確認時のエラーについて
- 複数のファイルが存在しない点について
- 【第四章の】mask.tar.gz download error 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 pytorch_advanced.