Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What are the in/output node names for Generator and Discriminator? #381

Open
whywww opened this issue May 17, 2020 · 1 comment
Open

What are the in/output node names for Generator and Discriminator? #381

whywww opened this issue May 17, 2020 · 1 comment

Comments

@whywww
Copy link

whywww commented May 17, 2020

I'm trying to export a frozen pb file from the trained checkpoint file, how can I know the input and output node names for G and D?

I've tried summarize_graph but it gave me lots of possible nodes. It's hard to tell which.

Thanks!!!

@0buo
Copy link

0buo commented Nov 24, 2020

I print out the ops in the frozen graph and only see the generator model: (ignore all the 'prefix/' in names)

name:  prefix/z         |       type:  Placeholder      |       outputs: [<tf.Tensor 'prefix/z:0' shape=(?, 512) dtype=float32>]

name:  prefix/generator/g_h0_lin/Matrix         |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_h0_lin/Matrix:0' shape=(512, 131072) dtype=float32>]

name:  prefix/generator/g_h0_lin/Matrix/read    |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_h0_lin/Matrix/read:0' shape=(512, 131072) dtype=float32>]

name:  prefix/generator/g_h0_lin/bias   |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_h0_lin/bias:0' shape=(131072,) dtype=float32>]

name:  prefix/generator/g_h0_lin/bias/read      |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_h0_lin/bias/read:0' shape=(131072,) dtype=float32>]

name:  prefix/generator/g_bn0/beta      |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_bn0/beta:0' shape=(512,) dtype=float32>]

name:  prefix/generator/g_bn0/beta/read         |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_bn0/beta/read:0' shape=(512,) dtype=float32>]

name:  prefix/generator/g_bn0/gamma     |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_bn0/gamma:0' shape=(512,) dtype=float32>]

name:  prefix/generator/g_bn0/gamma/read        |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_bn0/gamma/read:0' shape=(512,) dtype=float32>]

name:  prefix/generator/g_bn0/moving_mean       |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_bn0/moving_mean:0' shape=(512,) dtype=float32>]

name:  prefix/generator/g_bn0/moving_mean/read  |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_bn0/moving_mean/read:0' shape=(512,) dtype=float32>]

name:  prefix/generator/g_bn0/moving_variance   |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_bn0/moving_variance:0' shape=(512,) dtype=float32>]

name:  prefix/generator/g_bn0/moving_variance/read      |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_bn0/moving_variance/read:0' shape=(512,) dtype=float32>]

name:  prefix/generator/g_h1/w  |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_h1/w:0' shape=(5, 5, 256, 512) dtype=float32>]

name:  prefix/generator/g_h1/w/read     |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_h1/w/read:0' shape=(5, 5, 256, 512) dtype=float32>]

name:  prefix/generator/g_h1/biases     |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_h1/biases:0' shape=(256,) dtype=float32>]

name:  prefix/generator/g_h1/biases/read        |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_h1/biases/read:0' shape=(256,) dtype=float32>]

name:  prefix/generator/g_bn1/beta      |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_bn1/beta:0' shape=(256,) dtype=float32>]

name:  prefix/generator/g_bn1/beta/read         |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_bn1/beta/read:0' shape=(256,) dtype=float32>]

name:  prefix/generator/g_bn1/gamma     |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_bn1/gamma:0' shape=(256,) dtype=float32>]

name:  prefix/generator/g_bn1/gamma/read        |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_bn1/gamma/read:0' shape=(256,) dtype=float32>]

name:  prefix/generator/g_bn1/moving_mean       |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_bn1/moving_mean:0' shape=(256,) dtype=float32>]

name:  prefix/generator/g_bn1/moving_mean/read  |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_bn1/moving_mean/read:0' shape=(256,) dtype=float32>]

name:  prefix/generator/g_bn1/moving_variance   |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_bn1/moving_variance:0' shape=(256,) dtype=float32>]

name:  prefix/generator/g_bn1/moving_variance/read      |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_bn1/moving_variance/read:0' shape=(256,) dtype=float32>]

name:  prefix/generator/g_h2/w  |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_h2/w:0' shape=(5, 5, 128, 256) dtype=float32>]

name:  prefix/generator/g_h2/w/read     |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_h2/w/read:0' shape=(5, 5, 128, 256) dtype=float32>]

name:  prefix/generator/g_h2/biases     |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_h2/biases:0' shape=(128,) dtype=float32>]

name:  prefix/generator/g_h2/biases/read        |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_h2/biases/read:0' shape=(128,) dtype=float32>]

name:  prefix/generator/g_bn2/beta      |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_bn2/beta:0' shape=(128,) dtype=float32>]

name:  prefix/generator/g_bn2/beta/read         |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_bn2/beta/read:0' shape=(128,) dtype=float32>]

name:  prefix/generator/g_bn2/gamma     |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_bn2/gamma:0' shape=(128,) dtype=float32>]

name:  prefix/generator/g_bn2/gamma/read        |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_bn2/gamma/read:0' shape=(128,) dtype=float32>]

name:  prefix/generator/g_bn2/moving_mean       |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_bn2/moving_mean:0' shape=(128,) dtype=float32>]

name:  prefix/generator/g_bn2/moving_mean/read  |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_bn2/moving_mean/read:0' shape=(128,) dtype=float32>]

name:  prefix/generator/g_bn2/moving_variance   |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_bn2/moving_variance:0' shape=(128,) dtype=float32>]

name:  prefix/generator/g_bn2/moving_variance/read      |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_bn2/moving_variance/read:0' shape=(128,) dtype=float32>]

name:  prefix/generator/g_h3/w  |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_h3/w:0' shape=(5, 5, 64, 128) dtype=float32>]

name:  prefix/generator/g_h3/w/read     |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_h3/w/read:0' shape=(5, 5, 64, 128) dtype=float32>]

name:  prefix/generator/g_h3/biases     |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_h3/biases:0' shape=(64,) dtype=float32>]

name:  prefix/generator/g_h3/biases/read        |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_h3/biases/read:0' shape=(64,) dtype=float32>]

name:  prefix/generator/g_bn3/beta      |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_bn3/beta:0' shape=(64,) dtype=float32>]

name:  prefix/generator/g_bn3/beta/read         |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_bn3/beta/read:0' shape=(64,) dtype=float32>]

name:  prefix/generator/g_bn3/gamma     |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_bn3/gamma:0' shape=(64,) dtype=float32>]

name:  prefix/generator/g_bn3/gamma/read        |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_bn3/gamma/read:0' shape=(64,) dtype=float32>]

name:  prefix/generator/g_bn3/moving_mean       |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_bn3/moving_mean:0' shape=(64,) dtype=float32>]

name:  prefix/generator/g_bn3/moving_mean/read  |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_bn3/moving_mean/read:0' shape=(64,) dtype=float32>]

name:  prefix/generator/g_bn3/moving_variance   |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_bn3/moving_variance:0' shape=(64,) dtype=float32>]

name:  prefix/generator/g_bn3/moving_variance/read      |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_bn3/moving_variance/read:0' shape=(64,) dtype=float32>]

name:  prefix/generator/g_h4/w  |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_h4/w:0' shape=(5, 5, 3, 64) dtype=float32>]

name:  prefix/generator/g_h4/w/read     |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_h4/w/read:0' shape=(5, 5, 3, 64) dtype=float32>]

name:  prefix/generator/g_h4/biases     |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator/g_h4/biases:0' shape=(3,) dtype=float32>]

name:  prefix/generator/g_h4/biases/read        |       type:  Identity         |       outputs: [<tf.Tensor 'prefix/generator/g_h4/biases/read:0' shape=(3,) dtype=float32>]

name:  prefix/generator_1/g_h0_lin/MatMul       |       type:  MatMul   |       outputs: [<tf.Tensor 'prefix/generator_1/g_h0_lin/MatMul:0' shape=(?, 131072) dtype=float32>]

name:  prefix/generator_1/g_h0_lin/add  |       type:  AddV2    |       outputs: [<tf.Tensor 'prefix/generator_1/g_h0_lin/add:0' shape=(?, 131072) dtype=float32>]

name:  prefix/generator_1/Reshape/shape         |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator_1/Reshape/shape:0' shape=(4,) dtype=int32>]

name:  prefix/generator_1/Reshape       |       type:  Reshape  |       outputs: [<tf.Tensor 'prefix/generator_1/Reshape:0' shape=(?, 16, 16, 512) dtype=float32>]

name:  prefix/generator_1/g_bn0/FusedBatchNormV3        |       type:  FusedBatchNormV3         |       outputs: [<tf.Tensor 'prefix/generator_1/g_bn0/FusedBatchNormV3:0' shape=(?, 16, 16, 512) dtype=float32>, <tf.Tensor 'prefix/generator_1/g_bn0/FusedBatchNormV3:1' shape=(512,) dtype=float32>, <tf.Tensor 'prefix/generator_1/g_bn0/FusedBatchNormV3:2' shape=(512,) dtype=float32>, <tf.Tensor 'prefix/generator_1/g_bn0/FusedBatchNormV3:3' shape=(512,) dtype=float32>, <tf.Tensor 'prefix/generator_1/g_bn0/FusedBatchNormV3:4' shape=(512,) dtype=float32>, <tf.Tensor 'prefix/generator_1/g_bn0/FusedBatchNormV3:5' shape=<unknown> dtype=float32>]

name:  prefix/generator_1/Relu  |       type:  Relu     |       outputs: [<tf.Tensor 'prefix/generator_1/Relu:0' shape=(?, 16, 16, 512) dtype=float32>]

name:  prefix/generator_1/g_h1/conv2d_transpose/input_sizes     |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator_1/g_h1/conv2d_transpose/input_sizes:0' shape=(4,) dtype=int32>]

name:  prefix/generator_1/g_h1/conv2d_transpose         |       type:  Conv2DBackpropInput      |       outputs: [<tf.Tensor 'prefix/generator_1/g_h1/conv2d_transpose:0' shape=(1, 32, 32, 256) dtype=float32>]

name:  prefix/generator_1/g_h1/BiasAdd  |       type:  BiasAdd  |       outputs: [<tf.Tensor 'prefix/generator_1/g_h1/BiasAdd:0' shape=(1, 32, 32, 256) dtype=float32>]

name:  prefix/generator_1/g_h1/Reshape/shape    |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator_1/g_h1/Reshape/shape:0' shape=(4,) dtype=int32>]

name:  prefix/generator_1/g_h1/Reshape  |       type:  Reshape  |       outputs: [<tf.Tensor 'prefix/generator_1/g_h1/Reshape:0' shape=(1, 32, 32, 256) dtype=float32>]

name:  prefix/generator_1/g_bn1/FusedBatchNormV3        |       type:  FusedBatchNormV3         |       outputs: [<tf.Tensor 'prefix/generator_1/g_bn1/FusedBatchNormV3:0' shape=(1, 32, 32, 256) dtype=float32>, <tf.Tensor 'prefix/generator_1/g_bn1/FusedBatchNormV3:1' shape=(256,) dtype=float32>, <tf.Tensor 'prefix/generator_1/g_bn1/FusedBatchNormV3:2' shape=(256,) dtype=float32>, <tf.Tensor 'prefix/generator_1/g_bn1/FusedBatchNormV3:3' shape=(256,) dtype=float32>, <tf.Tensor 'prefix/generator_1/g_bn1/FusedBatchNormV3:4' shape=(256,) dtype=float32>, <tf.Tensor 'prefix/generator_1/g_bn1/FusedBatchNormV3:5' shape=<unknown> dtype=float32>]

name:  prefix/generator_1/Relu_1        |       type:  Relu     |       outputs: [<tf.Tensor 'prefix/generator_1/Relu_1:0' shape=(1, 32, 32, 256) dtype=float32>]

name:  prefix/generator_1/g_h2/conv2d_transpose/input_sizes     |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator_1/g_h2/conv2d_transpose/input_sizes:0' shape=(4,) dtype=int32>]

name:  prefix/generator_1/g_h2/conv2d_transpose         |       type:  Conv2DBackpropInput      |       outputs: [<tf.Tensor 'prefix/generator_1/g_h2/conv2d_transpose:0' shape=(1, 64, 64, 128) dtype=float32>]

name:  prefix/generator_1/g_h2/BiasAdd  |       type:  BiasAdd  |       outputs: [<tf.Tensor 'prefix/generator_1/g_h2/BiasAdd:0' shape=(1, 64, 64, 128) dtype=float32>]

name:  prefix/generator_1/g_h2/Reshape/shape    |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator_1/g_h2/Reshape/shape:0' shape=(4,) dtype=int32>]

name:  prefix/generator_1/g_h2/Reshape  |       type:  Reshape  |       outputs: [<tf.Tensor 'prefix/generator_1/g_h2/Reshape:0' shape=(1, 64, 64, 128) dtype=float32>]

name:  prefix/generator_1/g_bn2/FusedBatchNormV3        |       type:  FusedBatchNormV3         |       outputs: [<tf.Tensor 'prefix/generator_1/g_bn2/FusedBatchNormV3:0' shape=(1, 64, 64, 128) dtype=float32>, <tf.Tensor 'prefix/generator_1/g_bn2/FusedBatchNormV3:1' shape=(128,) dtype=float32>, <tf.Tensor 'prefix/generator_1/g_bn2/FusedBatchNormV3:2' shape=(128,) dtype=float32>, <tf.Tensor 'prefix/generator_1/g_bn2/FusedBatchNormV3:3' shape=(128,) dtype=float32>, <tf.Tensor 'prefix/generator_1/g_bn2/FusedBatchNormV3:4' shape=(128,) dtype=float32>, <tf.Tensor 'prefix/generator_1/g_bn2/FusedBatchNormV3:5' shape=<unknown> dtype=float32>]

name:  prefix/generator_1/Relu_2        |       type:  Relu     |       outputs: [<tf.Tensor 'prefix/generator_1/Relu_2:0' shape=(1, 64, 64, 128) dtype=float32>]

name:  prefix/generator_1/g_h3/conv2d_transpose/input_sizes     |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator_1/g_h3/conv2d_transpose/input_sizes:0' shape=(4,) dtype=int32>]

name:  prefix/generator_1/g_h3/conv2d_transpose         |       type:  Conv2DBackpropInput      |       outputs: [<tf.Tensor 'prefix/generator_1/g_h3/conv2d_transpose:0' shape=(1, 128, 128, 64) dtype=float32>]

name:  prefix/generator_1/g_h3/BiasAdd  |       type:  BiasAdd  |       outputs: [<tf.Tensor 'prefix/generator_1/g_h3/BiasAdd:0' shape=(1, 128, 128, 64) dtype=float32>]

name:  prefix/generator_1/g_h3/Reshape/shape    |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator_1/g_h3/Reshape/shape:0' shape=(4,) dtype=int32>]

name:  prefix/generator_1/g_h3/Reshape  |       type:  Reshape  |       outputs: [<tf.Tensor 'prefix/generator_1/g_h3/Reshape:0' shape=(1, 128, 128, 64) dtype=float32>]

name:  prefix/generator_1/g_bn3/FusedBatchNormV3        |       type:  FusedBatchNormV3         |       outputs: [<tf.Tensor 'prefix/generator_1/g_bn3/FusedBatchNormV3:0' shape=(1, 128, 128, 64) dtype=float32>, <tf.Tensor 'prefix/generator_1/g_bn3/FusedBatchNormV3:1' shape=(64,) dtype=float32>, <tf.Tensor 'prefix/generator_1/g_bn3/FusedBatchNormV3:2' shape=(64,) dtype=float32>, <tf.Tensor 'prefix/generator_1/g_bn3/FusedBatchNormV3:3' shape=(64,) dtype=float32>, <tf.Tensor 'prefix/generator_1/g_bn3/FusedBatchNormV3:4' shape=(64,) dtype=float32>, <tf.Tensor 'prefix/generator_1/g_bn3/FusedBatchNormV3:5' shape=<unknown> dtype=float32>]

name:  prefix/generator_1/Relu_3        |       type:  Relu     |       outputs: [<tf.Tensor 'prefix/generator_1/Relu_3:0' shape=(1, 128, 128, 64) dtype=float32>]

name:  prefix/generator_1/g_h4/conv2d_transpose/input_sizes     |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator_1/g_h4/conv2d_transpose/input_sizes:0' shape=(4,) dtype=int32>]

name:  prefix/generator_1/g_h4/conv2d_transpose         |       type:  Conv2DBackpropInput      |       outputs: [<tf.Tensor 'prefix/generator_1/g_h4/conv2d_transpose:0' shape=(1, 256, 256, 3) dtype=float32>]

name:  prefix/generator_1/g_h4/BiasAdd  |       type:  BiasAdd  |       outputs: [<tf.Tensor 'prefix/generator_1/g_h4/BiasAdd:0' shape=(1, 256, 256, 3) dtype=float32>]

name:  prefix/generator_1/g_h4/Reshape/shape    |       type:  Const    |       outputs: [<tf.Tensor 'prefix/generator_1/g_h4/Reshape/shape:0' shape=(4,) dtype=int32>]

name:  prefix/generator_1/g_h4/Reshape  |       type:  Reshape  |       outputs: [<tf.Tensor 'prefix/generator_1/g_h4/Reshape:0' shape=(1, 256, 256, 3) dtype=float32>]

name:  prefix/generator_1/Tanh  |       type:  Tanh     |       outputs: [<tf.Tensor 'prefix/generator_1/Tanh:0' shape=(1, 256, 256, 3) dtype=float32>]

If I understand it correctly, the layer of type Placeholder is the input and the tanh is the output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants