Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Tensorflow1.X migration to 2. 0 tutorial

Shulou Source: shulou.com Published: 2022-06-02 04:22:35 10月31日 Update

This article mainly explains the "Tensorflow1.X migration to 2.0 tutorial", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's train of thought slowly in depth, together to study and study the "Tensorflow1.X migration to 2.0 tutorial" bar!

Directory order script conversion folder batch conversion considerations single script conversion first go to the directory where you want to convert the script (eg:yolov3.py), and then:

Tf_upgrade_v2-- infile yolov3.py-- outfile yolov3.py folder batch conversion first enter the folder root directory (eg:yolov3/) you want to convert, and then you can convert all py files under the file:

Tf_upgrade_v2-- intree yolov3/-- outtree yolov3/-- copyotherfiles False considerations

1. An error like "tf.placeholder () is not compatible with eager execution" may be reported after the conversion, just add this sentence after the normal import tensorflow:

Import tensorflow as tftf.compat.v1.disable_eager_execution ()

The 2.tf2.0 version deprecates libraries like tf.flags, and you may have to reinstall absl.flags or switch to a package in tensorflow/addons to successfully migrate the code.

Thank you for your reading, the above is the content of "Tensorflow1.X Migration to 2.0 tutorial", after the study of this article, I believe you have a deeper understanding of the problem of Tensorflow1.X migration to 2.0 tutorial, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Files tutorials folders scripts learning events content notes directories success code that is ideas situations articles more root directories versions knowledge knowledge points Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Shulou Tech Info vpn Huawei Apple