Last active
March 24, 2020 18:29
-
-
Save tc87/585976da558b9ca87724f9136e335565 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@st.cache(allow_output_mutation=True, hash_funcs=TL_GAN_HASH_FUNCS) | |
def load_pg_gan_model(): | |
""" | |
Create the tensorflow session. | |
""" | |
config = tf.ConfigProto(allow_soft_placement=True) | |
session = tf.Session(config=config) | |
with session.as_default(): | |
with open(MODEL_FILE_GPU if USE_GPU else MODEL_FILE_CPU, 'rb') as f: | |
G = pickle.load(f) | |
return session, G |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment