Exporting a frozen graph .pb file in Tensorflow 2

I have also faced this same problem while migrating from tensorflow1.x to tensoflow2.0 beta. This problem can be solved by 2 methods:

  1. 1st is to go to the tensflow2.0 docs search for the methods you have used and change the syntax for each line &
  2. To use google's tf_ugrade_v2 script

tf_upgrade_v2 --infile your_tf1_script_file --outfile converted_tf2_file

You try above command to change your tensorflow1.x script to tensorflow2.0, it will solve all your problem.

Also, you can rename the method (Manual step by refering documentation) Rename 'tf.graph_util.convert_variables_to_constants' to 'tf.compat.v1.graph_util.convert_variables_to_constants'

The measure problem is that in tensorflow2.0 is that many syntax and function has changed try referring the tensoflow2.0 docs or use the google's tf_upgrade_v2 script