Still requires Tensorflow 1 dnnlib
The notebook still requires dnnlib, which is only compatable with TF1. So the notebook at least is not a stylegan for TF2, and does not belong in this repo, or am I missing something?
Would be great to get a requirements.txt of a working environment for this - would love to get this running.
install it (tensorflow 1.x) run the first part of the notebook (until it saves the model). Than, uninstall 1.x and work with TF 2... I dont know why the author did not commit the TF 2 saved model. By anyway, seems that he abandoned the project, so good luck. Remember to NOT use the first part anymore.
Thats all you need after saving the new model:
import numpy as np
from stylegan import StyleGAN_G
from stylegan import copy_weights_to_keras_model
import pickle
import matplotlib.pyplot as plt
import time
model = StyleGAN_G()
all_weights = pickle.load(open('gs_weights.pkl', 'rb'))
print('Weights loaded to memory.')
copy_weights_to_keras_model(model.model_mapping, all_weights)
copy_weights_to_keras_model(model.model_synthesis, all_weights)
model.generate_sample(is_visualize=True)
PS.: Install cuda tookit from nvidia (I installed 12.1) and install tensorflow >= 2.6 (I think mine 2.6.2). However, it might not find the cuda dlls, so, use conda to install cudakit 11 (?)
conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0
I forgot to generate the weights for all the trained models (just the karas 1024), if any of you follow those instructions, I apreciate if you, before erasing the TF 1, generate the pickle file for all the models and made them avaiable. Thank you! If anyone want I can provide the pickle for the karas 1024 (the standard one).