captain-pool / GSOC

Repository for Google Summer of Code 2019 https://summerofcode.withgoogle.com/projects/#4662790671826944

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Converted ShuffleNet Module Not Working

captain-pool opened this issue · comments

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

@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()
......
......