Open cihatkapusuz opened 3 years ago
I have the same problem. I also have NVlab's 'Stylegan2-ADA', 'Stylegan2-ADA-PyTorch' models. (.pkl files)
I do not know how to load the parameters as NumPy.ndarray. I apologize for such a beginner's question.
Any model weights (ideally) should be stored like a dictionary or a recursive dictionary. Some key-value pairs should be the parameter name
-pre-trained weight
pairs, where parameter name
should be a string and pre-trained weight
should be a tensor (pytorch or tensorflow version, both of which can be easily converted to numpy.ndarray
). Please Google how to convert a pytorch (or tensorflow) tensor to a numpy.ndarray
if you are really new to these two DL frameworks.
So, I would recommend first load the pkl
file with ipython, and then check how the file is organized with print()
function.
We have a model stored as .pkl file which is trained on NVIDIA's StyleGAN. Since its extension is .pkl, and your structure asks for a .pth file, is there any way to convert our .pkl file to .pth file? Or is there any way to work on your system with a .pkl file?