-
Notifications
You must be signed in to change notification settings - Fork 86
tf_upgrade_v2 for network/classification/resnet.py #1069
tf_upgrade_v2 for network/classification/resnet.py #1069
Conversation
This is the whole convert log:
|
tf_upgrade_v2 sometimes changed argment to keyword argument. Because API has changed by changing from tf1 to tf2. avg_pool
tf2:https://www.tensorflow.org/api_docs/python/tf/nn/avg_pool2d
tf.pad
tf2:https://www.tensorflow.org/api_docs/python/tf/pad
tf.shape
tf2:https://www.tensorflow.org/api_docs/python/tf/shape
tf.argmax tf1:https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/math/argmax
tf2:https://www.tensorflow.org/api_docs/python/tf/math/argmax
tf.reduce_sum
tf2:https://www.tensorflow.org/api_docs/python/tf/math/reduce_sum
tf.reduce_mean
tf2:https://www.tensorflow.org/api_docs/python/tf/math/reduce_mean
|
ff80e01
to
e9eb5db
Compare
This PR needs Approvals as follows.
Please choose reviewers and requet reviews! Click to see how to approve each reviewsYou can approve this PR by triggered comments as follows.
See all trigger commentsPlease replace [Target] to review target
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OA
labels = tf.compat.v1.Print(labels, | ||
[tf.shape(labels), tf.argmax(labels, axis=1)], | ||
message="labels:", | ||
summarize=200) | ||
softmax = tf.compat.v1.Print(softmax, | ||
[tf.shape(softmax), tf.argmax(softmax, axis=1)], | ||
message="softmax:", | ||
summarize=200) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about this? It's more consistent with the other function calls in this file.
labels = tf.compat.v1.Print(
labels,
[tf.shape(labels), tf.argmax(labels, axis=1)],
message="labels:",
summarize=200
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. OK. I fixed it for consistency!
ad53179
to
b0227b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RA
/ready |
⏳Merge job is queued... |
What this patch does to fix the issue.
I converted only the blueoil/network/classification/resnet.py with the command line tool tf_upgrade_v2 to run on tensorflow2 because there are a lot of targets in the network folder.
Here's what I did:
install newest tenosrflow (tensorflow-gpu==1.5.2)
Run the upgrade script tf_upgrade_v2
Check the upgrade report for warnings and errors
Run test (make test)
Link to any relevant issues or pull requests.