Use TF 1.x and 2.x in same script

Wondering if anyone has insight into how to run both TF 1.x and TF 2.x in the same python program. I understand that its possible to use

import tensorflow.compat.v1 as tf

but my use case might be a bit different. Basically I’m using a forked gpt-2-simple github repo which is fully written in tf 1.x and within the same program i need to utilize tf hub which is obviously only in tf 2.x.

If anyone know if/how these two versions can run in unison I think that would be very helpful and insightful to the community as well.
*Insert snide comment about how many issues tf 2.x has caused me*

submitted by /u/ThatAi_guy
[visit reddit] [comments]

Leave a Reply

Your email address will not be published. Required fields are marked *