Training Using Google Colab

Training your model
Forum rules
Read the FAQs and search the forum before posting a new topic.

Please mark any answers that fixed your problems so others can find the solutions.
Post Reply
User avatar
RakaMaru
Posts: 2
Joined: Tue Jun 16, 2020 12:14 am
Been thanked: 1 time

Training Using Google Colab

Post by RakaMaru »

Hello Faceswap Community.

I have spent weeks here learning and using tips to get good results in Faceswap. Thank you for this great community.

Lately I've been struggling with training times, so I decided to try to use the Google Colab, and the results are very good. Training for the same results, using the Colab has cut my training from weeks to just days.

In gratitude, I thought I would share my notebook which I'm currently using.

https://github.com/RakaMaru/Faceswap_Go ... lab_Master

Thank you

User avatar
RakaMaru
Posts: 2
Joined: Tue Jun 16, 2020 12:14 am
Been thanked: 1 time

Re: Training Using Google Colab

Post by RakaMaru »

To keep the Colab from timing out, use this.

Google Colab Keep-Alive Script
----
function ClickConnect(){
console.log(Date().toLocaleString());
document.querySelector("document-info").click()
}setInterval(ClickConnect,60000)
----

In Chrome (Ctrl-Shift-i), then paste into the console.

User avatar
Bolos
Posts: 2
Joined: Thu Jun 25, 2020 1:53 pm

Re: Training Using Google Colab

Post by Bolos »

Hi,

And before i get myself ambarrassed, i'd like to thank you, and everyone involved in this deepfake madness. :)

I've been trying to use your googlecolab workflow since i got to make faceswap work on my computer, but it's my working machine and it can't do both ^^. (by the way i'm on a mac, the trashcan one with a pair of amd D700 6gb)

So i think i got everything working from your google colab sheet (i pressed the make a copy, hope i don't messup up anything this way) but the last section "Run training" ( 06/30/2020 00:02:39 ERROR The Timelapse path '/content/face_a' does not contain any valid images).

I'm sorry to bother, since i'm a newborn noob, and despites my good will to try to read what is requested and/or hapening, i have to admit, i don't get much out of it.

I did make the same path in my google drive: My drive/colab_files/faceswap/faces --- with two zip files named face_a.zip
and face_c.zip (the names of the jpg files inside are differend tho img_21656.jpg and Poutin.13565.jpg)
They have been extracted with faceswap and are 256x256. (it's the same set i've worked fine on my desktop)

(EDIT) I read somewhere in the code that the image size is set on 128, so i changed mines to 128. But still having the same problem with : "The Timelapse path '/content/face_a' does not contain any valid images"

I did one thing i'm not confident at all just before this step, when the collab script asked to choose between
1 - AMD 2 - CPU 3 - NVIDA As i said i'm running a trashcan so i'm stock with amd but i still choosed nvidia thinking it's not my computer running... I made a mistake right?

If you had time to maybe kindly tell me where to go find some more informations on what have gone wrong at that step?
Meanwhile i'll go read more on the googlecollab notice ^^'

Thanks from advance.

M.
Last edited by Bolos on Tue Jun 30, 2020 3:17 pm, edited 1 time in total.

User avatar
bryanlyon
Site Admin
Posts: 322
Joined: Fri Jul 12, 2019 12:49 am
Answers: 27
Location: San Francisco
Has thanked: 3 times
Been thanked: 87 times
Contact:

Re: Training Using Google Colab

Post by bryanlyon »

It wont work with zipped images. The folder has to have the actual images extracted. That said, timelapse is an optional mode and you can just leave that blank and run without timelapse if you want.

User avatar
Bolos
Posts: 2
Joined: Thu Jun 25, 2020 1:53 pm

Re: Training Using Google Colab

Post by Bolos »

Thank you for the answear. I might just pass for even dumber than i actually am, but i thought that in the collab sheet it is mentioned to put all images of face_a with the correct alignments.fsa fil and zip it... And of course same for face_b. I followed the nicely done collab sheetmentionned in the first post of RakaMaru.

There even is an action for unzipping the folders... But i might get something on the naming wrong. In the unzziping results there is this as a result on the section "Download training data": (it did that for all the images, that's just the last lines)

inflating: face_b/__MACOSX/face_b/._face_b_00890.jpg
inflating: face_b/face_b/face_b_03341.jpg
inflating: face_b/__MACOSX/face_b/._face_b_03341.jpg

So i'm actually renaming the files at start so the name is only numbers... Probably loosing my time ^^' i mean learning :)

As for the timelaps, if i un derstood correctly, it's a sort of preview in or for g colab? The things is i didn't change anything on the code, but try hard to make my project fit it... And understand a few things along :)

Again thanks for your answear, feel a bit bad as if i was waisting poeple's time ^^

Cheers

M

Post Reply