Code Monkey home page Code Monkey logo

Comments (6)

VainF avatar VainF commented on August 26, 2024

Hi @pyh99715. In Deeplabv3-ResNet101, model.backbone.conv1 is the first conv layer. You can build the model directly and then replace model.backbone.conv1 with a new 4-channel Conv layers, i.e., nn.Conv2d(4, ...).

from deeplabv3plus-pytorch.

Neflibatata avatar Neflibatata commented on August 26, 2024

I have tried to find the first layer of the network structure before(resnet101 for example), but I can't seem to find the location that defines the first layer, is it in network/backbone/resnet.py line 48?
I am new to this field, and some questions may be relatively stupid, please forgive me :p

from deeplabv3plus-pytorch.

VainF avatar VainF commented on August 26, 2024

The first layer is defined in line 139 of ResNet.

from deeplabv3plus-pytorch.

Neflibatata avatar Neflibatata commented on August 26, 2024

I'm very sorry, I found it two minutes after I replied to you just now. I looked for it in the code of _deeplab.py for a long time. I am not familiar with this aspect. 💇‍♂ Then if resnet101 can take this form to change to four-channel input, others such as resnet50, mobilenet, etc. can also modify conv1 in this way to modify the entire network ?

from deeplabv3plus-pytorch.

VainF avatar VainF commented on August 26, 2024

Yes, you can change the first layer to match your inputs.
But, the operation for mobilenet is more complicated because it does not have a separate conv1. You need to modify the first element (L119) of model.backbone.features .

from deeplabv3plus-pytorch.

Neflibatata avatar Neflibatata commented on August 26, 2024

Thank you so much for your help, I even emailed you for help. I think this project is not the same as many similar projects. It is more complete and efficient. May I ask if you implemented it yourself?
This is really an admirable job 👍 👍 👍

from deeplabv3plus-pytorch.

Related Issues (20)

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.