PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 10 May 2022 08:38 PM by  Patrick Ng
Update codes from Tensorflow 1.0 to 2.0 - Road Taken
 0 Replies
Sort:
You are not authorized to post a reply.
Author Messages
Patrick Ng
Basic Member
Basic Member
Posts:104


--
10 May 2022 08:38 PM
    If you are, like me, have bunch of deep neural network (DNN) Tensorflow 1.0 (tf.1) codes that served their purpose, but now want to run on GPU and perform more experiments faster, then the following may help save a weekend (rather than banging head tracking down barrage of error messages).

    Issue - Tensorflow 2 (tf.2) supports GPU but is not backward compatible (tf.1 codes won't run as is).

    Lesson 1 - upgrade from tf.1 to tf.2 (i.e., completed installation), the first roadblock is that placeholders in your codes (how tf.1 handles constants and variables) are no longer recognized in tf.2. Not want to make drastic changes to the codes without planned testing, one option is to suppress tf.2 behavior.

    Workaround link -

    https://stackoverflow.com...ttribute-placeholder

    Lesson 2 - deeper you get into DNN code blocks, sooner or later, there come more error messages and headaches. Fire fighting code block one at a time can be tedious and turn into a nightmare.

    Useful link to get over the hump -
    https://stackoverflow.com...er-in-tensorflow-2-0

    Final decision? Bite the bullet and embrace tf.2 @tf.function wholeheartedly, and take out placeholders from each block accordingly.

    Good luck in your own journey of running tf.2 on GPU.




    0
    You are not authorized to post a reply.