Converted ShuffleNet Module Not Working
captain-pool opened this issue · comments
Adrish Dey commented
Tensorflow Version: 1.14
OS Version: Elementary OS Loki
Built from Source: No
Code to Reproduce:
$ python3 export.py
import tensorflow_hub as hub
import tensorflow as tf
module = hub.Module("onnx/shufflenet/1")
preds = module(tf.random_normal(shape=[1, 3, 224, 224], dtype=tf.float32)
with tf.Session() as sess:
print(sess.run(preds))
Current Output
Error Thrown
PyFunc:0 not Found
Expected Output:
No Error
CC: @srjoglekar246
Adrish Dey commented
CC: @vbardiovskyg
Prince Garg commented
Adrish Dey commented
@gargprince1702 please check your version of TensorFlow installation. TF2.0 doesn't have session in the main namespace. Instead it is present in the compatibility namespace.
So to use Session in TF2.0
This is what you need to do.
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
......
......
Prince Garg commented