コードを TensorFlow 2 に自動的にアップグレードする
anacondaプロンプトから
>tf_upgrade_v2 --intree tensorflow_v1 --outtree tensorflow_v2 --reportfile report.txt
・intree側にコンバートしたいソースを全部入れる
・windows環境ではintree側のファイルをutf-8でなくshift-JISにしないと実行できなかった
・outtree側のフォルダが既設だとエラーで止まる
↓
修正策が見つからない部分はレポートが出る
↓
RuntimeError: tf.placeholder() is not compatible with eager execution
↓
プレースホルダーの代わりに空のテンソルを指定するか、
tf.compat.v1.disable_eager_execution()
を付け加えるんだそうだ
↓
無事実行できた
でも出来たソースは非推奨なので
コンバート自体を仕事で請け負ってる場合はこれは使えないんだろうなぁ