Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Add export network trainable variables (PRETRAIN_VARS) to experiment dir #1179

Merged
merged 3 commits into from
Aug 26, 2020

Conversation

oatawa1
Copy link
Contributor

@oatawa1 oatawa1 commented Aug 25, 2020

What this patch does to fix the issue.

Add export network trainable variables (PRETRAIN_VARS) to the experiment directory.

Example:
Network: LmnetV1Quantize (https://docs.blue-oil.org/tutorial/image_cls.html)

path/to/experiment/pretrain_vars.txt

[
    'conv1/conv2d/kernel:0',
    'conv1/BatchNorm/beta:0',
    'conv1/BatchNorm/gamma:0',
    'conv2/conv2d/kernel:0',
    'conv2/BatchNorm/beta:0',
    'conv2/BatchNorm/gamma:0',
    'conv3/conv2d/kernel:0',
    'conv3/BatchNorm/beta:0',
    'conv3/BatchNorm/gamma:0',
    'conv4/conv2d/kernel:0',
    'conv4/BatchNorm/beta:0',
    'conv4/BatchNorm/gamma:0',
    'conv5/conv2d/kernel:0',
    'conv5/BatchNorm/beta:0',
    'conv5/BatchNorm/gamma:0',
    'conv6/conv2d/kernel:0',
    'conv6/BatchNorm/beta:0',
    'conv6/BatchNorm/gamma:0',
    'conv7/kernel:0',
    'conv7/bias:0',
]

Link to any relevant issues or pull requests.

Closes #1178

@oatawa1 oatawa1 requested a review from iizukak August 25, 2020 04:29
@blueoil-butler blueoil-butler bot added the CI: auto-run Run CI automatically label Aug 25, 2020
@bo-code-review-bot
Copy link

This PR needs Approvals as follows.

  • Ownership Approval for / from iizukak, tkng, ruimashita
  • Readability Approval for Python from tkng, tsawada, tfujiwar, a-hanamoto

Please choose reviewers and requet reviews!

Click to see how to approve each reviews

You can approve this PR by triggered comments as follows.

  • Approve all reviews requested to you (readability and ownership) and LGTM review
    Approval, LGTM

  • Approve all ownership reviews
    Ownership Approval or OA

  • Approve all readability reviews
    Readability Approval or RA

  • Approve specified review targets

    • Example of Ownership Reviewer of /: Ownership Approval for / or OA for /
    • Example of Readability Reviewer of Python: Readability Approval for Python or RA for Python
  • Approve LGTM review
    LGTM

See all trigger comments

Please replace [Target] to review target

  • Ownership Approval
    • Ownership Approval for [Target]
    • OA for [Target]
    • Ownership Approval
    • OA
    • Approval
  • Readability Approval
    • Readability Approval for [Target]
    • RA for [Target]
    • [Target] Readability Approval
    • [Target] RA
    • Readability Approval
    • RA
    • Approval
  • LGTM
    • LGTM
    • lgtm

@oatawa1 oatawa1 self-assigned this Aug 25, 2020
@oatawa1 oatawa1 requested a review from iizukak August 25, 2020 05:44
Copy link
Member

@iizukak iizukak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OA

@oatawa1 oatawa1 requested a review from tfujiwar August 25, 2020 05:50
Comment on lines +127 to +129
pretrain_vars_file.writelines("[\n")
pretrain_vars_file.writelines(" '%s',\n" % var.name for var in train_vars)
pretrain_vars_file.writelines("]\n")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to use json.dumps if you want to format the file as JSON.

Copy link
Contributor

@tfujiwar tfujiwar Aug 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, it's a part of python (config.py). Please ignore this comment.

Copy link
Contributor

@tfujiwar tfujiwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RA

@iizukak
Copy link
Member

iizukak commented Aug 26, 2020

/ready

@bo-mergebot
Copy link
Contributor

bo-mergebot bot commented Aug 26, 2020

⏳Merge job is queued...

@bo-mergebot bo-mergebot bot merged commit 610ac8c into blue-oil:master Aug 26, 2020
@oatawa1 oatawa1 deleted the export-pretrainvars branch August 28, 2020 07:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI: auto-run Run CI automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need a list of PRETRAIN_VARS for fine tuning
3 participants