Comments (8)
If you just want to change the base network from vgg to mobile net, simply create you feature extract layers and top feature extract layers like here.
The parameters initializer should be configured when you define layers, the two places you referred are used to invoke initializer your predefined.
from gluon-faster-rcnn.
fixed_params is the array of those layers params name you want to fix.
You could print net.collect_param() and copy names you want to fix.
then modify this fuction.
from gluon-faster-rcnn.
If i don't want to fix any params, How to remove that fix param things? I want to train it from the scratch.. Bcz my dataset is different... So..
Also i trained the network with mobilnet base.. But i am not getting map.. I am getting worst map as 0.003..
What could be the reason??
What exactly should i change here include mobilenet? please help me out in this.
I did something like .
I just removed flattened layer.
i have removed last 5 layers from base at the top.
for layer in base_model.features[:-5]:
and added 3 bottom layers in rcnnHEAD..
for layer in base_model.features[-3:]:
self.fc_layers.add(layer)
self.cls_score = nn.Dense(in_units=160, units=num_classes, weight_initializer=initializer.Normal(0.01))
self.bbox_pred = nn.Dense(in_units=160, units=num_classes * 4, weight_initializer=initializer.Normal(0.001))
Is it correct?
or should i do it in a different way?
from gluon-faster-rcnn.
If you don't want to fix any params, just comment this line:
gluon-faster-rcnn/train_faster_rcnn.py
Line 297 in 0e786f5
For your second question, I'm not familiar with mobilenet.
Could not help more, sorry.
And maybe you could post you code in detail.
from gluon-faster-rcnn.
Okay. Thank You.. I will do that...
I will try to work on it first. then i will post it if something is not happening.
from gluon-faster-rcnn.
I have done something like this to include mobilenet as base network..
But i am getting Map as 0 even after 5 epochs.
I have randomized the weights.
I have not changed anything else from the source code...
Please help me out in getting some good map.. Let me know the mistake i have done in the network.
class MobileNet_mod(nn.HybridBlock):
def __init__(self, base_model, multiplier=0.25, classes=3, **kwargs):
super(MobileNet_mod, self).__init__(**kwargs)
with self.name_scope():
self.features = nn.HybridSequential(prefix='')
for layer in base_model.features[:-35]:
self.features.add(layer)
def hybrid_forward(self, F, x, *args, **kwargs):
x = self.features(x)
#x = self.output(x)
return x
class MObFastRCNNHead(HybridBlock):
def __init__(self, base_model, num_classes, feature_stride, **kwargs):
super(MObFastRCNNHead, self).__init__(**kwargs)
self.feature_stride = feature_stride
self.bottom = nn.HybridSequential()
# Include last 2 mobilenet feature layers
for layer in base_model.features[-2:]:
self.bottom.add(layer)
self.cls_score = nn.Dense(in_units=128, units=num_classes, weight_initializer=initializer.Normal(0.01))
self.bbox_pred = nn.Dense(in_units=128, units=num_classes * 4, weight_initializer=initializer.Normal(0.001))
def hybrid_forward(self, F, feature_map, rois):
x = F.ROIPooling(data=feature_map, rois=rois, pooled_size=(3, 3), spatial_scale=1.0 / self.feature_stride)
x = self.bottom(x)
cls_score = self.cls_score(x)
cls_prob = F.softmax(data=cls_score) # shape(roi_num, num_classes)
bbox_pred = self.bbox_pred(x) # shape(roi_num, num_classes*4)
return cls_prob, bbox_pred
from gluon-faster-rcnn.
What mobilenet you used and passed by base_model
?
Also, check whether the pooled_size
and feature_stride
configurations is fit for your network.
And you could debug into the network, check outputs are correct or not.
from gluon-faster-rcnn.
I have passed mobilenet0.25 .. it is mobilenet V1 alpha 0.25
I have excluded last 11 layers in the feature extraction.
and used last 2 layers (avgpool2d and flatten) in rcnn part.
i have changed pooling size to (3,3)
Should i change anything else??
I have given stride number as 16 only, since my input data is of 512*512 as of now..
from gluon-faster-rcnn.
Related Issues (9)
- Could you share the training log of your faster rcnn(vgg16)? HOT 2
- Could you share the pre-trained model parameters? HOT 3
- Working on Windows with same accuracy HOT 11
- Issue with demo_faster_rcnn.py script. HOT 9
- How does C++ call the model HOT 2
- Regarding testing accuracy and class score values
- Increasing Accuracy HOT 5
- network is not learning if not hybridized 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 gluon-faster-rcnn.