[Resource] Google Colab Notebook

Want to use Faceswap in The Cloud? This is not directly supported by the Devs, but you may find community support here


Forum rules

Read the FAQs and search the forum before posting a new topic.

NB: The Devs do not directly support using Cloud based services, but you can find community support here.

Please mark any answers that fixed your problems so others can find the solutions.

User avatar
Andentze
Posts: 15
Joined: Mon Dec 06, 2021 6:34 pm
Has thanked: 1 time
Been thanked: 21 times

Re: [Resource] Google Colab Notebook

Post by Andentze »

Unfortunately for all of us, Colab users, Google is blacklisting all notebooks which are associated with deepfaking by any means and are banning accounts which keep on using those notebooks.

Do not fret though, as I am currently searching for another way to use Faceswap in the cloud. I'll keep you guys updated if I do find one(either by creating a new topic or by replying to/editing this one).

User avatar
aolvera27
Posts: 27
Joined: Thu May 27, 2021 3:53 am
Answers: 1
Has thanked: 5 times
Been thanked: 6 times

Re: [Resource] Google Colab Notebook

Post by aolvera27 »

Same thing happened to me during the weekend. However, I noticed they updated the list of countries where Colab Pro is available, and it's now possible for me to suscribe (which I think is fair), and I can confirm that training a deepfake model is still allowed with a Pro account. It is a shame that the list of elligible countries is very limited, though.

User avatar
Andentze
Posts: 15
Joined: Mon Dec 06, 2021 6:34 pm
Has thanked: 1 time
Been thanked: 21 times

Re: [Resource] Google Colab Notebook

Post by Andentze »

Alright. Here's my plan. There's a theory that Google is hunting down the notebooks which have either DFL or Faceswap or anything that makes deepfaking possible, filters them and blocks them. So my idea is to spoof the notebook entirely so barely anything is left and minimize the chance of banning. That means no extract, no convert, no fancy stuff.
I am really not sure if this will work. Won't know if we don't try.

I will leave this here for you guys to see if that warning is gone and if it would return. For me, its basically gone.
https://colab.research.google.com/drive ... sp=sharing

User avatar
aolvera27
Posts: 27
Joined: Thu May 27, 2021 3:53 am
Answers: 1
Has thanked: 5 times
Been thanked: 6 times

No module named 'tensorflow_probability'

Post by aolvera27 »

I'm getting this error when attempting training or conversion on Colab. Extraction works just fine, and the Notebook had been working just fine until today. Is there some kind of update or maintenance going on?

06/24/2022 12:14:08 INFO Loading Model from Villain plugin...
06/24/2022 12:14:09 CRITICAL Error caught! Exiting...
06/24/2022 12:14:09 ERROR Caught exception in thread: '_training_0'
06/24/2022 12:14:11 ERROR Got Exception on main handler:
ModuleNotFoundError: No module named 'tensorflow_probability'

User avatar
Andentze
Posts: 15
Joined: Mon Dec 06, 2021 6:34 pm
Has thanked: 1 time
Been thanked: 21 times

Re: No module named 'tensorflow_probability'

Post by Andentze »

aolvera27 wrote: Fri Jun 24, 2022 5:23 pm

I'm getting this error when attempting training or conversion on Colab. Extraction works just fine, and the Notebook had been working just fine until today. Is there some kind of update or maintenance going on?

06/24/2022 12:14:08 INFO Loading Model from Villain plugin...
06/24/2022 12:14:09 CRITICAL Error caught! Exiting...
06/24/2022 12:14:09 ERROR Caught exception in thread: '_training_0'
06/24/2022 12:14:11 ERROR Got Exception on main handler:
ModuleNotFoundError: No module named 'tensorflow_probability'

I forgot to catch up with the updates that torzdf has pushed so far. Fixed, I think. I can't really test that as I have 0 models to train as of now.

User avatar
aolvera27
Posts: 27
Joined: Thu May 27, 2021 3:53 am
Answers: 1
Has thanked: 5 times
Been thanked: 6 times

Re: [Resource] Google Colab Notebook

Post by aolvera27 »

So I got this new error:

Code: Select all

ModuleNotFoundError: No module named 'ipykernel'

I dutifully wrote

Code: Select all

!conda install ipykernel

, and it worked for a couple of days, but now I got this message:

Code: Select all

KeyError: 'figure.raise_window is not a valid rc parameter (see rcParams.keys() for a list of valid parameters)'

As before, extraction is working fine. The problem occurs when attemppting a training session.

User avatar
torzdf
Posts: 2752
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 141 times
Been thanked: 643 times

Re: [Resource] Google Colab Notebook

Post by torzdf »

That was code I added in a recent commit to stop the preview window from stealing focus (on normal systems).

figure.raise_window definitely is a valid rcParam, so either you have an outdated version of matplotlib or Colab just doesn't like it for whatever reason.

My word is final

User avatar
aolvera27
Posts: 27
Joined: Thu May 27, 2021 3:53 am
Answers: 1
Has thanked: 5 times
Been thanked: 6 times

Re: [Resource] Google Colab Notebook

Post by aolvera27 »

You were right. Updating matplotlib to 3.5.2 did the trick.

Thanks!

User avatar
aolvera27
Posts: 27
Joined: Thu May 27, 2021 3:53 am
Answers: 1
Has thanked: 5 times
Been thanked: 6 times

Re: [Resource] Google Colab Notebook

Post by aolvera27 »

Well, this looks like it should be an easy fix, but I can't work it out.

When I try to copy the contents of Google Drive to a Colab session:

Code: Select all

!cp "/content/drive/My Drive/colab_files/faces/face_a.zip" .
!cp "/content/drive/My Drive/colab_files/faces/face_b.zip" .

!unzip face_a.zip -d face_a
!unzip face_b.zip -d face_b

I get this message:

Code: Select all

cp: relocation error: /lib/x86_64-linux-gnu/libacl.so.1: symbol getxattr version ATTR_1.0 not defined in file libattr.so.1 with link time reference
User avatar
Andentze
Posts: 15
Joined: Mon Dec 06, 2021 6:34 pm
Has thanked: 1 time
Been thanked: 21 times

Re: [Resource] Google Colab Notebook

Post by Andentze »

aolvera27 wrote: Fri Aug 26, 2022 1:24 pm

Well, this looks like it should be an easy fix, but I can't work it out.

When I try to copy the contents of Google Drive to a Colab session:

Code: Select all

!cp "/content/drive/My Drive/colab_files/faces/face_a.zip" .
!cp "/content/drive/My Drive/colab_files/faces/face_b.zip" .

!unzip face_a.zip -d face_a
!unzip face_b.zip -d face_b

I get this message:

Code: Select all

cp: relocation error: /lib/x86_64-linux-gnu/libacl.so.1: symbol getxattr version ATTR_1.0 not defined in file libattr.so.1 with link time reference

I always used

Code: Select all

!unzip "/content/drive/My Drive/colab_files/faces/face_a.zip" -d "/content/drive/My Drive/colab_files/faces/face_a"
!unzip "/content/drive/My Drive/colab_files/faces/face_b.zip" -d "/content/drive/My Drive/colab_files/faces/face_b"

and deleted the archives afterwards. It always worked out. Might work for you.

User avatar
cswpf
Posts: 1
Joined: Sat Apr 15, 2023 3:13 am

Re: [Resource] Google Colab Notebook

Post by cswpf »

Do anyone write this colab into TPU trained script?GPU is always disconnected and reallocate the computer.

User avatar
torzdf
Posts: 2752
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 141 times
Been thanked: 643 times

Re: [Resource] Google Colab Notebook

Post by torzdf »

Honestly, since Google banned deepfakes on Colab, I don't think anyone keeps their notebooks up to date any more.

My word is final

User avatar
Andentze
Posts: 15
Joined: Mon Dec 06, 2021 6:34 pm
Has thanked: 1 time
Been thanked: 21 times

Re: [Resource] Google Colab Notebook

Post by Andentze »

torzdf wrote: Sat Apr 15, 2023 12:06 pm

Honestly, since Google banned deepfakes on Colab, I don't think anyone keeps their notebooks up to date any more.

Google banned deepfaking only on free runtimes. I've managed to train an entire model for around 13 hours without disconnections(Captchas still can happen) and without any banning on any Premium class GPU.

Post Reply