Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

CPP resnet examples training acc does not increase,loss does not decrease #19430

Answered by pengzhao-intel
ZHEQIUSHUI asked this question in Q&A
Discussion options

You must be logged in to vote

I don't know if you're using example from cpp-package/example/resnet.cpp, but I couldn't run this example - I fixed it by replacing
Xavier xavier = Xavier(Xavier::gaussian, Xavier::in, 2);
with:
Xavier xavier = Xavier(Xavier::gaussian, Xavier::out, 2);
First run worked fine and net was learning, but second run shows similar issue with yours.
Probably it's problem with parameter initialization.
I fixed it by replacing:

  //Xavier xavier = Xavier(Xavier::gaussian, Xavier::out, 2); <- Replace xavier with default Initializer
  Initializer init = Initializer();
  for (auto &arg : args_map) {
    std::cout << arg.first << std::endl;
    init(arg.first, &arg.second); // <- changed variable name…

Replies: 10 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by szha
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #19430 on October 30, 2020 17:10.