dobrosketchkun/latent_space_adventures

How to use your own models in this notebook

Opened this issue · 3 comments

Hi I wanted to try out mixing the layers of two of my model .pkls using your notebook, I can get it to work for the models which come in the notebook (when you run the code line and it downloads them), but if I mount my drive and move MY .pkls to the same spot as the ones installed automatically by the "neural networks handling" cell, and try to blend those networks together it doesn't work? Not sure what I am doing wrong...

When I go to insert text here for the mix layers step - if I just put the name of the .pkl it doesn't work, unless I use the networks which were downloaded in the "neural networks handling" step...In which case it works if I just put in two of the names from the downloaded ones.

If I use my own networks for layers do I need to run the 'utility function step' for it to work or just "installs" & "mix layer"?

Hopefully there is an easy fix for this or something simple I am missing ( I am not a coder so just looking for an easy explanation how I could do this if possible). This seems to be the easiest notebook I have found for network blending that I can wrap my head around, now if I could just get it to work for my own networks... thanks for making this.

if I mount my drive and move MY .pkls to the same spot as the ones installed automatically by the "neural networks handling" cell, and try to blend those networks together it doesn't work? Not sure what I am doing wrong...

So you are saying you mount your google drive and copy your styleGAN2-ada model .pkl files in /content/ folder? What type of error are we talking about?

If I use my own networks for layers do I need to run the 'utility function step' for it to work

Yes, you should run it.

I figured out what to do -
1)mount google drive

from google.colab import drive
drive.mount('/content/drive')

2)I had to replace your .json link with my .json link, and then I uploaded the .json file itself into the content folder of Gdrive. In order to run the cell properly first you have to click the 3 verticle dots on the right of the "nueral networks handling cell", click show code, and then change the .json link to your github link (which you have to create beforehand by making a repository on github and uploading the .json file to gdrive content folder).

3)Next change the code right below this to the actual .json file location itself - see where it says 'content/...' right under the github 'raw' .json url link you just changed.

Thats what you will replace with the file path of the .json file(you will need to upload the .json file to your gdrive content folder and click copy path). the .json file structure looks like this:
{"portraits" : "https://drive.google.com/file/d/10hCoR57tc0q40_WwezxSOAiNXKmqPE/view?usp=sharing",
"variety" : "https://drive.google.com/file/d/10hCoR57tc0q40_WyGweSOAiNXKmqPE/view?usp=sharing"}

After the cell runs, you will be able to type in the names for each network which you want to mix.

Yeah, it's one way to address this issue. I'm glad you figured it out since I'm was kind of slow on a solution.