[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.

Post Reply
User avatar
Andentze
Posts: 5
Joined: Mon Dec 06, 2021 6:34 pm
Has thanked: 1 time
Been thanked: 7 times

[Resource] Google Colab Notebook

Post by Andentze »

Message from moderator torzdf

This is the latest working Colab Notebook provided by the Faceswap community.

The old topic can be found here for reference: viewtopic.php?f=23&t=744



Hello! I was working on a notebook of mine to provide full functionality of Faceswap in the Google Colab just because I feel bad for people that can't wait for the exctract of convert to finish, but is able to run the GUI perfectly fine(or not, if your CPU isn't supporting the AVX instructions(in which case I do feel bad for you))

So, I'll just stop that useless rambling and give away my Colab notebook that I have been working on for a while. It will be updated in case of compability issue or Faceswap bringing out something cool that my current notebook won't be able to run. But for now, the main functionality(and a couple of tools) are present here. Any feedback would be appreciated :P

Here's the notebook itself. I sure hope you can do something with it, low-end PC/laptop users :D
https://github.com/andentze/FaceColab_Unofficial


User avatar
torzdf
Posts: 1680
Joined: Fri Jul 12, 2019 12:53 am
Answers: 130
Has thanked: 70 times
Been thanked: 319 times

Re: Google Colab Notebook

Post by torzdf »

I don't use Colab, but if people test this notebook and feedback that it all works well, I will pin it as I have a feeling that the currently pinned notebook is now a little out of date.

My word is final


User avatar
Robb96
Posts: 1
Joined: Wed Feb 02, 2022 6:41 pm
Has thanked: 2 times
Been thanked: 3 times

Re: Google Colab Notebook

Post by Robb96 »

Andentze wrote: Tue Jan 18, 2022 3:18 pm

Hello! I was working on a notebook of mine to provide full functionality of Faceswap in the Google Colab just because I feel bad for people that can't wait for the exctract of convert to finish, but is able to run the GUI perfectly fine(or not, if your CPU isn't supporting the AVX instructions(in which case I do feel bad for you))

So, I'll just stop that useless rambling and give away my Colab notebook that I have been working on for a while. It will be updated in case of compability issue or Faceswap bringing out something cool that my current notebook won't be able to run. But for now, the main functionality(and a couple of tools) are present here. Any feedback would be appreciated :P

Here's the notebook itself. I sure hope you can do something with it, low-end PC/laptop users :D
https://github.com/andentze/FaceColab_Unofficial

Made an account to thank you for the working notebook. Haven't been able find one without errors in a very long time.

Last edited by Robb96 on Thu Feb 03, 2022 7:43 pm, edited 1 time in total.

User avatar
pilipinoguy
Posts: 9
Joined: Tue Mar 08, 2022 5:14 am
Has thanked: 8 times

Re: [Resource] Google Colab Notebook

Post by pilipinoguy »

Hi,

Started training my model using this free google colab. My question is how do you change the parameters of the trainer (like loss, choice of trainer like adabelief, etc) since you can only change the main ones like iterations, batch size, save every.. etc

BTW its much faster than my videocard lol.

Thanks


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

Re: [Resource] Google Colab Notebook

Post by Andentze »

pilipinoguy wrote: Sun Mar 20, 2022 3:26 pm

Hi,

Started training my model using this free google colab. My question is how do you change the parameters of the trainer (like loss, choice of trainer like adabelief, etc) since you can only change the main ones like iterations, batch size, save every.. etc

BTW its much faster than my videocard lol.

Thanks

Hello! Unfortunately, I was unable to implement the configuration setup yet. I am planning to do so, so please. Stay patient for now.


User avatar
pilipinoguy
Posts: 9
Joined: Tue Mar 08, 2022 5:14 am
Has thanked: 8 times

Re: [Resource] Google Colab Notebook

Post by pilipinoguy »

Thanks for that, you are simply awesome.

Also, why not place Phaze-A on as well since you will be implementing the configuration setup. Im planning to upgrade my free colab to colab pro for faster gpu. Im kinda a laptop guy so ur colab is a great help. Just want my mug to look good on my fav music videos, lol. Or swap my mug on a whole movie :-)


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

Re: [Resource] Google Colab Notebook

Post by Andentze »

pilipinoguy wrote: Wed Mar 23, 2022 6:36 am

Thanks for that, you are simply awesome.

Also, why not place Phaze-A on as well since you will be implementing the configuration setup. Im planning to upgrade my free colab to colab pro for faster gpu. Im kinda a laptop guy so ur colab is a great help. Just want my mug to look good on my fav music videos, lol. Or swap my mug on a whole movie :-)

I didn't realize I forgot to put that there. Thanks for the notice. I'll put Phaze-A as one of the choices for the model when I implement the config setup.


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

Notebook Update

Post by Andentze »

I probably shouldn't leave my messages like this, but eh, doesn't matter. Just pushed a really nice update which completely remade the way Faceswap is being installed to Colab and it works flawlessly. It now utilizes Conda for packages. So now, Tensorflow 2.5+ is supported. I've spent the last few weeks figuring this one thing out, and I finally did.

Enjoy, I guess?


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

Re: [Resource] Google Colab Notebook

Post by aolvera27 »

Thanks a lot!

It actually worked flawlessly, as you said. Only today I started getting this message when trying to run trainning:

Code: Select all

Setting Faceswap backend to NVIDIA
Traceback (most recent call last):
  File "faceswap/faceswap.py", line 6, in <module>
    from lib.cli import args as cli_args
  File "/content/faceswap/lib/cli/args.py", line 13, in <module>
    from lib.gpu_stats import GPUStats
  File "/content/faceswap/lib/gpu_stats/__init__.py", line 9, in <module>
    from ._base import set_exclude_devices  # noqa
  File "/content/faceswap/lib/gpu_stats/_base.py", line 8, in <module>
    from typing import List, Optional, TypedDict
ImportError: cannot import name 'TypedDict' from 'typing' (/usr/lib/python3.7/typing.py)

User avatar
torzdf
Posts: 1680
Joined: Fri Jul 12, 2019 12:53 am
Answers: 130
Has thanked: 70 times
Been thanked: 319 times

Re: [Resource] Google Colab Notebook

Post by torzdf »

This was down to an update I pushed today not supporting Python 3.7 (the Colab default). I have now fixed this, so hopefully the notebook should be working again now.

My word is final


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

Re: [Resource] Google Colab Notebook

Post by aolvera27 »

I was excited because that's exactly what I thought, that there must have been an update running, affecting Python. However, I'm getting an almost identical error now:

Code: Select all

Setting Faceswap backend to NVIDIA
Traceback (most recent call last):
  File "faceswap/faceswap.py", line 6, in <module>
    from lib.cli import args as cli_args
  File "/content/faceswap/lib/cli/args.py", line 13, in <module>
    from lib.gpu_stats import GPUStats
  File "/content/faceswap/lib/gpu_stats/__init__.py", line 9, in <module>
    from ._base import set_exclude_devices  # noqa
  File "/content/faceswap/lib/gpu_stats/_base.py", line 14, in <module>
    from typing import TypedDict
ImportError: cannot import name 'TypedDict' from 'typing' (/usr/lib/python3.7/typing.py)

User avatar
torzdf
Posts: 1680
Joined: Fri Jul 12, 2019 12:53 am
Answers: 130
Has thanked: 70 times
Been thanked: 319 times

Re: [Resource] Google Colab Notebook

Post by torzdf »

:oops: My mistake, I put the imports in the wrong way around. Should work now.

My word is final


Post Reply