Skip to content

Conversation

OwenLiuzZ
Copy link
Collaborator

@OwenLiuzZ OwenLiuzZ commented Aug 3, 2018

Checklist

  • I've tested that my changes are compatible with the latest version of Tensorflow.
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.

Motivation and Context

Description

1.add tutorial of TensorLayer work with ONNX framework

@tensorlayer tensorlayer deleted a comment Aug 3, 2018
@tensorlayer tensorlayer deleted a comment Aug 3, 2018
@tensorlayer tensorlayer deleted a comment Aug 3, 2018
@tensorlayer tensorlayer deleted a comment Aug 3, 2018
@tensorlayer tensorlayer deleted a comment Aug 3, 2018
@tensorlayer tensorlayer deleted a comment Aug 3, 2018
@tensorlayer tensorlayer deleted a comment Aug 3, 2018
@tensorlayer tensorlayer deleted a comment Aug 3, 2018
@tensorlayer tensorlayer deleted a comment Aug 3, 2018
@tensorlayer tensorlayer deleted a comment Aug 3, 2018
@tensorlayer tensorlayer deleted a comment Aug 3, 2018
@tensorlayer tensorlayer deleted a comment Aug 3, 2018
@tensorlayer tensorlayer deleted a comment Aug 3, 2018
@tensorlayer tensorlayer deleted a comment Aug 3, 2018
@tensorlayer tensorlayer deleted a comment Aug 3, 2018
@tensorlayer tensorlayer deleted a comment Aug 3, 2018
@tensorlayer tensorlayer deleted a comment Aug 3, 2018
@tensorlayer tensorlayer deleted a comment Aug 3, 2018
y_ = tf.placeholder(tf.int64, shape=[batch_size])

net = tl.layers.InputLayer(x, name='input')
## Professional conv API for tensorflow expert
Copy link
Member

Choose a reason for hiding this comment

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

Remove unused code.


if __name__ == '__main__':

#sess = tf.InteractiveSession()
Copy link
Member

Choose a reason for hiding this comment

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

Remove unused code

acc = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
# y_op = tf.argmax(tf.nn.softmax(y), 1)

# You can add more penalty to the cost function as follow.
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this code?

print(" test acc: %f" % (test_acc / n_batch))


if __name__ == '__main__':
Copy link
Member

Choose a reason for hiding this comment

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

As we discussed, we shall have a main function that is classified into four stages:

  1. Load a pre-trained model
  2. Save pre-trained model into two files: ckpt and pb.
  3. Save the ckpt and pb as a onnx file
  4. load the onnx file
  5. use the onnx file (which can be currently commented out)

The main function should have this structure.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok, I will change the structure of the main function as we discussed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Another advice for the function is that shall we supply the stage that train the model from scratch ?

@tensorlayer tensorlayer deleted a comment Aug 4, 2018
@tensorlayer tensorlayer deleted a comment Aug 4, 2018
@tensorlayer tensorlayer deleted a comment Aug 4, 2018
@tensorlayer tensorlayer deleted a comment Aug 4, 2018
@tensorlayer tensorlayer deleted a comment Aug 4, 2018
@tensorlayer tensorlayer deleted a comment Aug 4, 2018
@tensorlayer tensorlayer deleted a comment Aug 4, 2018
@tensorlayer tensorlayer deleted a comment Aug 8, 2018
@tensorlayer tensorlayer deleted a comment Aug 8, 2018
@tensorlayer tensorlayer deleted a comment Aug 8, 2018
@tensorlayer tensorlayer deleted a comment Aug 8, 2018
@tensorlayer tensorlayer deleted a comment Aug 8, 2018
@tensorlayer tensorlayer deleted a comment Aug 8, 2018
@tensorlayer tensorlayer deleted a comment Aug 8, 2018
@tensorlayer tensorlayer deleted a comment Aug 8, 2018
@tensorlayer tensorlayer deleted a comment Aug 8, 2018
@luomai luomai changed the title [WIP] add tutorial of TensorLayer work with ONNX framework Add a tutorial to describe how to use ONNX in TensorLayer Aug 8, 2018
@tensorlayer tensorlayer deleted a comment Aug 8, 2018
@tensorlayer tensorlayer deleted a comment Aug 8, 2018
@tensorlayer tensorlayer deleted a comment Aug 8, 2018
@tensorlayer tensorlayer deleted a comment Aug 8, 2018
@tensorlayer tensorlayer deleted a comment Aug 8, 2018
@tensorlayer tensorlayer deleted a comment Aug 8, 2018
@tensorlayer tensorlayer deleted a comment Aug 8, 2018
@tensorlayer tensorlayer deleted a comment Aug 8, 2018
@tensorlayer tensorlayer deleted a comment Aug 8, 2018
@tensorlayer tensorlayer deleted a comment Aug 8, 2018
@tensorlayer tensorlayer deleted a comment Aug 8, 2018
@tensorlayer tensorlayer deleted a comment Aug 8, 2018
@tensorlayer tensorlayer deleted a comment Aug 8, 2018
@luomai luomai merged commit c0f6d6a into tensorlayer:master Aug 8, 2018
luomai pushed a commit that referenced this pull request Nov 21, 2018
* add tutorial of TensorLayer work with ONNX framework

* modify the changelog

* remove the unused code

* remove the useless code

* modify  the code with yapf format

* modify the structure of the tutotial

* modify the format with yapf

* add pip onnx-tf

* modify the onnx tutorial structure

* modify the format

* fix the Trailing whitespace

* add the contribution in changelog
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

Successfully merging this pull request may close these issues.

3 participants