Loading pretrained model in TensorflowTensorflow: how to save/restore a model?TensorFlow saving into/loading a graph from a fileTensorflow: use pretrained inception modelReset weights of a pretrained incetion_v3 model in TensorflowTensorFlow object detection api: classification weights initialization when changing number of classes at training using pre-trained modelsHow to reuse classification layers in Tensorflow Object Detection APIModify pretrained model in tensorflowTraining ssd inception_v3 using pretrained model from slimTensorflow: Download and run pretrained VGG or ResNet modelWarning: variable is not available in checkpoint
When did England stop being a Papal fief?
How to properly store the current value of int variable into a token list?
Where to draw the line between quantum mechanics theory and its interpretation(s)?
Has the Hulk always been able to talk?
Make me a minimum magic sum
Why would a military not separate its forces into different branches?
How to pass query parameters in URL in Salesforce Summer 19 Release?
How to deal with employer who keeps me at work after working hours
Krull dimension of the ring of global sections
What do you call a painting on a wall?
How to pass hash as password to ssh server
Some Russian letters overlap the next line of text when used in drop caps
Is throwing dice a stochastic or a deterministic process?
What makes an isotope stable?
How to remap repeating commands i.e. <number><command>?
How to preserve a rare version of a book?
Why are oscilloscope input impedances so low?
Why did the Apollo 13 crew extend the LM landing gear?
Sci-fi/fantasy book - ships on steel runners skating across ice sheets
Should homeowners insurance cover the cost of the home?
Game artist computer workstation set-up – is this overkill?
Why does sound not move through a wall?
Is 'contemporary' ambiguous and if so is there a better word?
Why would one crossvalidate the random state number?
Loading pretrained model in Tensorflow
Tensorflow: how to save/restore a model?TensorFlow saving into/loading a graph from a fileTensorflow: use pretrained inception modelReset weights of a pretrained incetion_v3 model in TensorflowTensorFlow object detection api: classification weights initialization when changing number of classes at training using pre-trained modelsHow to reuse classification layers in Tensorflow Object Detection APIModify pretrained model in tensorflowTraining ssd inception_v3 using pretrained model from slimTensorflow: Download and run pretrained VGG or ResNet modelWarning: variable is not available in checkpoint
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
In this tutorial (creating new model for object detection), it is mentioned at the middle as
"We typically initialize the weights of this feature extractor using those from the Slim Resnet-101 classification checkpoint, and we know that images were preprocessed when training this checkpoint by subtracting a channel mean from each input image. Thus, we implement the preprocess function to replicate the same channel mean subtraction behavior."
Now I am trying to load pretrained model for MobileNet_v1_1.0_224 at this page.
I checked all variables from loaded checkpoint and those variables required to initialize in training FasterRcnn. Loaded checkpoint has more varaibles than those needed.
For example,
I need to initialize this variable 'FirstStageFeatureExtractor/MobilenetV1/Conv2d_0/BatchNorm/beta'.
But in loaded variables have
'MobilenetV1/Conv2d_0/BatchNorm/beta/ExponentialMovingAverage': [32]
'MobilenetV1/Conv2d_0/BatchNorm/beta/RMSProp_1': [32],
'MobilenetV1/Conv2d_0/BatchNorm/beta': [32],
My queries are
(1)So for me, it is enough to use the last one 'MobilenetV1/Conv2d_0/BatchNorm/beta' to initialize to 'FirstStageFeatureExtractor/MobilenetV1/Conv2d_0/BatchNorm/beta'.
Is it correct?
(2)What ExponentialMovingAverage and RMSProp_1 are for?
(3)Then how FirstStageFeatureExtractor and SecondStageFeatureExtractor are separated in FasterRcnn in Tensorflow?
(4)Those variables initialized use initialized weights, for those variable not initialized will use Xavier initializer according to config file, is it true?
initializer
variance_scaling_initializer
factor: 1.0
uniform: true
mode: FAN_AVG
EDIT:
Then for the variable MobilenetV1/Conv2d_12_pointwise/depthwise_weights shape=(3, 3, 512, 1), I can't find exact variable.
Those closer are
'MobilenetV1/Conv2d_12_depthwise/depthwise_weights': [3, 3, 512, 1],
'MobilenetV1/Conv2d_12_depthwise/depthwise_weights/RMSProp': [3, 3, 512, 1],
'MobilenetV1/Conv2d_12_depthwise/depthwise_weights/ExponentialMovingAverage': [3, 3, 512, 1],
'MobilenetV1/Conv2d_12_depthwise/depthwise_weights/RMSProp_1': [3, 3, 512, 1],
So I used weights of variable 'MobilenetV1/Conv2d_12_depthwise/depthwise_weights': [3, 3, 512, 1], from loaded checkpoint to assign to MobilenetV1/Conv2d_12_pointwise/depthwise_weights shape=(3, 3, 512, 1)
python tensorflow object-detection-api
add a comment |
In this tutorial (creating new model for object detection), it is mentioned at the middle as
"We typically initialize the weights of this feature extractor using those from the Slim Resnet-101 classification checkpoint, and we know that images were preprocessed when training this checkpoint by subtracting a channel mean from each input image. Thus, we implement the preprocess function to replicate the same channel mean subtraction behavior."
Now I am trying to load pretrained model for MobileNet_v1_1.0_224 at this page.
I checked all variables from loaded checkpoint and those variables required to initialize in training FasterRcnn. Loaded checkpoint has more varaibles than those needed.
For example,
I need to initialize this variable 'FirstStageFeatureExtractor/MobilenetV1/Conv2d_0/BatchNorm/beta'.
But in loaded variables have
'MobilenetV1/Conv2d_0/BatchNorm/beta/ExponentialMovingAverage': [32]
'MobilenetV1/Conv2d_0/BatchNorm/beta/RMSProp_1': [32],
'MobilenetV1/Conv2d_0/BatchNorm/beta': [32],
My queries are
(1)So for me, it is enough to use the last one 'MobilenetV1/Conv2d_0/BatchNorm/beta' to initialize to 'FirstStageFeatureExtractor/MobilenetV1/Conv2d_0/BatchNorm/beta'.
Is it correct?
(2)What ExponentialMovingAverage and RMSProp_1 are for?
(3)Then how FirstStageFeatureExtractor and SecondStageFeatureExtractor are separated in FasterRcnn in Tensorflow?
(4)Those variables initialized use initialized weights, for those variable not initialized will use Xavier initializer according to config file, is it true?
initializer
variance_scaling_initializer
factor: 1.0
uniform: true
mode: FAN_AVG
EDIT:
Then for the variable MobilenetV1/Conv2d_12_pointwise/depthwise_weights shape=(3, 3, 512, 1), I can't find exact variable.
Those closer are
'MobilenetV1/Conv2d_12_depthwise/depthwise_weights': [3, 3, 512, 1],
'MobilenetV1/Conv2d_12_depthwise/depthwise_weights/RMSProp': [3, 3, 512, 1],
'MobilenetV1/Conv2d_12_depthwise/depthwise_weights/ExponentialMovingAverage': [3, 3, 512, 1],
'MobilenetV1/Conv2d_12_depthwise/depthwise_weights/RMSProp_1': [3, 3, 512, 1],
So I used weights of variable 'MobilenetV1/Conv2d_12_depthwise/depthwise_weights': [3, 3, 512, 1], from loaded checkpoint to assign to MobilenetV1/Conv2d_12_pointwise/depthwise_weights shape=(3, 3, 512, 1)
python tensorflow object-detection-api
add a comment |
In this tutorial (creating new model for object detection), it is mentioned at the middle as
"We typically initialize the weights of this feature extractor using those from the Slim Resnet-101 classification checkpoint, and we know that images were preprocessed when training this checkpoint by subtracting a channel mean from each input image. Thus, we implement the preprocess function to replicate the same channel mean subtraction behavior."
Now I am trying to load pretrained model for MobileNet_v1_1.0_224 at this page.
I checked all variables from loaded checkpoint and those variables required to initialize in training FasterRcnn. Loaded checkpoint has more varaibles than those needed.
For example,
I need to initialize this variable 'FirstStageFeatureExtractor/MobilenetV1/Conv2d_0/BatchNorm/beta'.
But in loaded variables have
'MobilenetV1/Conv2d_0/BatchNorm/beta/ExponentialMovingAverage': [32]
'MobilenetV1/Conv2d_0/BatchNorm/beta/RMSProp_1': [32],
'MobilenetV1/Conv2d_0/BatchNorm/beta': [32],
My queries are
(1)So for me, it is enough to use the last one 'MobilenetV1/Conv2d_0/BatchNorm/beta' to initialize to 'FirstStageFeatureExtractor/MobilenetV1/Conv2d_0/BatchNorm/beta'.
Is it correct?
(2)What ExponentialMovingAverage and RMSProp_1 are for?
(3)Then how FirstStageFeatureExtractor and SecondStageFeatureExtractor are separated in FasterRcnn in Tensorflow?
(4)Those variables initialized use initialized weights, for those variable not initialized will use Xavier initializer according to config file, is it true?
initializer
variance_scaling_initializer
factor: 1.0
uniform: true
mode: FAN_AVG
EDIT:
Then for the variable MobilenetV1/Conv2d_12_pointwise/depthwise_weights shape=(3, 3, 512, 1), I can't find exact variable.
Those closer are
'MobilenetV1/Conv2d_12_depthwise/depthwise_weights': [3, 3, 512, 1],
'MobilenetV1/Conv2d_12_depthwise/depthwise_weights/RMSProp': [3, 3, 512, 1],
'MobilenetV1/Conv2d_12_depthwise/depthwise_weights/ExponentialMovingAverage': [3, 3, 512, 1],
'MobilenetV1/Conv2d_12_depthwise/depthwise_weights/RMSProp_1': [3, 3, 512, 1],
So I used weights of variable 'MobilenetV1/Conv2d_12_depthwise/depthwise_weights': [3, 3, 512, 1], from loaded checkpoint to assign to MobilenetV1/Conv2d_12_pointwise/depthwise_weights shape=(3, 3, 512, 1)
python tensorflow object-detection-api
In this tutorial (creating new model for object detection), it is mentioned at the middle as
"We typically initialize the weights of this feature extractor using those from the Slim Resnet-101 classification checkpoint, and we know that images were preprocessed when training this checkpoint by subtracting a channel mean from each input image. Thus, we implement the preprocess function to replicate the same channel mean subtraction behavior."
Now I am trying to load pretrained model for MobileNet_v1_1.0_224 at this page.
I checked all variables from loaded checkpoint and those variables required to initialize in training FasterRcnn. Loaded checkpoint has more varaibles than those needed.
For example,
I need to initialize this variable 'FirstStageFeatureExtractor/MobilenetV1/Conv2d_0/BatchNorm/beta'.
But in loaded variables have
'MobilenetV1/Conv2d_0/BatchNorm/beta/ExponentialMovingAverage': [32]
'MobilenetV1/Conv2d_0/BatchNorm/beta/RMSProp_1': [32],
'MobilenetV1/Conv2d_0/BatchNorm/beta': [32],
My queries are
(1)So for me, it is enough to use the last one 'MobilenetV1/Conv2d_0/BatchNorm/beta' to initialize to 'FirstStageFeatureExtractor/MobilenetV1/Conv2d_0/BatchNorm/beta'.
Is it correct?
(2)What ExponentialMovingAverage and RMSProp_1 are for?
(3)Then how FirstStageFeatureExtractor and SecondStageFeatureExtractor are separated in FasterRcnn in Tensorflow?
(4)Those variables initialized use initialized weights, for those variable not initialized will use Xavier initializer according to config file, is it true?
initializer
variance_scaling_initializer
factor: 1.0
uniform: true
mode: FAN_AVG
EDIT:
Then for the variable MobilenetV1/Conv2d_12_pointwise/depthwise_weights shape=(3, 3, 512, 1), I can't find exact variable.
Those closer are
'MobilenetV1/Conv2d_12_depthwise/depthwise_weights': [3, 3, 512, 1],
'MobilenetV1/Conv2d_12_depthwise/depthwise_weights/RMSProp': [3, 3, 512, 1],
'MobilenetV1/Conv2d_12_depthwise/depthwise_weights/ExponentialMovingAverage': [3, 3, 512, 1],
'MobilenetV1/Conv2d_12_depthwise/depthwise_weights/RMSProp_1': [3, 3, 512, 1],
So I used weights of variable 'MobilenetV1/Conv2d_12_depthwise/depthwise_weights': [3, 3, 512, 1], from loaded checkpoint to assign to MobilenetV1/Conv2d_12_pointwise/depthwise_weights shape=(3, 3, 512, 1)
python tensorflow object-detection-api
python tensorflow object-detection-api
edited Mar 23 at 6:45
batuman
asked Mar 23 at 2:52
batumanbatuman
2,595747112
2,595747112
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Yes what I did was correct. What variables are needed to initialize and what variable are available from loaded checkpoint can be checked from variable_names_map. From there, select the variable and initialize to further fine tuning.
Need a bit of modification to the Tensorflow's code mainly at utils/variables_helper.py file.
What to be in FirstStage and SecondStage of FasterRCNN are decided at faster_rcnn_mobilenet_v1_feature_extractor.py
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55310167%2floading-pretrained-model-in-tensorflow%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Yes what I did was correct. What variables are needed to initialize and what variable are available from loaded checkpoint can be checked from variable_names_map. From there, select the variable and initialize to further fine tuning.
Need a bit of modification to the Tensorflow's code mainly at utils/variables_helper.py file.
What to be in FirstStage and SecondStage of FasterRCNN are decided at faster_rcnn_mobilenet_v1_feature_extractor.py
add a comment |
Yes what I did was correct. What variables are needed to initialize and what variable are available from loaded checkpoint can be checked from variable_names_map. From there, select the variable and initialize to further fine tuning.
Need a bit of modification to the Tensorflow's code mainly at utils/variables_helper.py file.
What to be in FirstStage and SecondStage of FasterRCNN are decided at faster_rcnn_mobilenet_v1_feature_extractor.py
add a comment |
Yes what I did was correct. What variables are needed to initialize and what variable are available from loaded checkpoint can be checked from variable_names_map. From there, select the variable and initialize to further fine tuning.
Need a bit of modification to the Tensorflow's code mainly at utils/variables_helper.py file.
What to be in FirstStage and SecondStage of FasterRCNN are decided at faster_rcnn_mobilenet_v1_feature_extractor.py
Yes what I did was correct. What variables are needed to initialize and what variable are available from loaded checkpoint can be checked from variable_names_map. From there, select the variable and initialize to further fine tuning.
Need a bit of modification to the Tensorflow's code mainly at utils/variables_helper.py file.
What to be in FirstStage and SecondStage of FasterRCNN are decided at faster_rcnn_mobilenet_v1_feature_extractor.py
answered Mar 23 at 7:03
batumanbatuman
2,595747112
2,595747112
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55310167%2floading-pretrained-model-in-tensorflow%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown