-
Notifications
You must be signed in to change notification settings - Fork 482
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
Migrate to tensorflow 2 #46
Comments
+1 for this |
Hi there, I got stuck running at train_tf.py. WARNING:tensorflow:From C:\Users\user.conda\envs\tensorflow_env\lib\site-packages\tensorflow_core\python\compat\v2_compat.py:88: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version. SystemExit: 2 C:\Users\user.conda\envs\tensorflow_env\lib\site-packages\IPython\core\interactiveshell.py:3339: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D. |
@iSean97 you have to add that at the very beginning of the notebook file and make sure you don't have other tensorflow imports. Also, your error is actually mentioning an argument I recommend troubleshooting this general tensorflow problem elsewhere as it is not related the project here. |
Hi there |
Hi @yoyongbo , I don't believe there's a simple print like model.summary() provides, but there are a couple of things you can do to visualize the model. The best way to do it would be using tensorboard, which lets you interactively explore the model graph. You can prepare the model for viewing on tensorboard like this: import tensorflow as tf
out_dir = './tensorboard_graph'
meta_file = 'models/COVID-Net_CXR-2/model.meta'
graph = tf.Graph()
with graph.as_default():
tf.train.import_meta_graph(meta_file)
writer = tf.summary.FileWriter(out_dir, graph)
writer.close() You can then run tensorboard and view the graph in a browser at localhost:6006 (or whichever port you're using) via this command
If you don't care about the structure and you just want a list of all the operations (in no particular order), you can try import tensorflow as tf
meta_file = 'models/COVID-Net_CXR-2/model.meta'
graph = tf.Graph()
with graph.as_default():
tf.train.import_meta_graph(meta_file)
for n in graph.as_graph_def().node:
print(n.name) |
Thanks!!
…On Thu, Apr 8, 2021 at 5:56 PM Hayden Gunraj ***@***.***> wrote:
*CAUTION:* This email originated from outside of UPEI. Do not click links
or open attachments unless you recognize the sender and know the content is
safe. If you are uncertain, please forward to ***@***.*** and delete
this email.
Hi @yoyongbo <https://github.com/yoyongbo> ,
I don't believe there's a simple print like model.summary() provides, but
there are a couple of things you can do to visualize the model. The best
way to do it would be using tensorboard
<https://www.tensorflow.org/tensorboard>, which lets you interactively
explore the model graph. You can prepare the model for viewing on
tensorboard like this:
import tensorflow as tf
out_dir = './tensorboard_graph'
meta_file = 'models/COVID-Net_CXR-2/model.meta'
graph = tf.Graph()
with graph.as_default():
tf.train.import_meta_graph(meta_file)
writer = tf.summary.FileWriter(out_dir, graph)
writer.close()
You can then run tensorboard and view the graph in a browser at
localhost:6006 (or whichever port you're using) via this command
tensorboard --logdir=./tensorboard_graph --port=6006
If you don't care about the structure and you just want a list of all the
operations (in no particular order), you can try
import tensorflow as tf
meta_file = 'models/COVID-Net_CXR-2/model.meta'
graph = tf.Graph()
with graph.as_default():
tf.train.import_meta_graph(meta_file)
for n in graph.as_graph_def().node:
print(n.name)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#46 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHSFVRRYPHNY646A54NN5ELTHYJ6BANCNFSM4MLEMFHA>
.
|
Can you please make your code compatible with Tensorflow 2.0+ by default.
Pretty easy to do with no code changes, see:
https://www.tensorflow.org/guide/migrate
Just add this wherever you previously imported
tensorflow
:And update your
requirements.txt
per #45The text was updated successfully, but these errors were encountered: