# flameSimpleML - Flame Machine Learning Source/Target tool with bespoke training

**URL:** <https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800>\
**Category:** Flame Questions\
**Tags:** ml\
**Created:** [January 14, 2024, 10:26am UTC](https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800 "2024-01-14T10:26:30Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![talosh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/talosh/32/963_2.png) [@talosh](https://forum.logik.tv/u/talosh)\
**Post date:** [January 17, 2024, 8:45am UTC](https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800/21 "2024-01-17T08:45:07Z")

</div>

Just noticed one thing while trying to prepare video - while exporting exr’s make sure to uncheck “include alpha” box so it has 3 channels. That type of models can have any number of input and output channels but at the moment there a lots of assumptions of having only 3 RGB channels for both input and output. I’ll try to work around it in next release

---

<div class="post-metadata">

**Author:** ![philobedo](https://avatars.discourse-cdn.com/v4/letter/p/b19c9b/32.png) [@philobedo](https://forum.logik.tv/u/philobedo)\
**Post date:** [January 17, 2024, 3:18pm UTC](https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800/22 "2024-01-17T15:18:09Z")

</div>

OMG!!! Wanna try that. Great work @talosh

---

<div class="post-metadata">

**Author:** ![talosh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/talosh/32/963_2.png) [@talosh](https://forum.logik.tv/u/talosh)\
**Post date:** [January 17, 2024, 10:52pm UTC](https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800/23 "2024-01-17T22:52:33Z")

</div>

There is a quick bugfix release:

[https://github.com/talosh/flameSimpleML/releases/tag/v0.0.2](https://github.com/talosh/flameSimpleML/releases/tag/v0.0.2)

1. Default learning rate lowered from 0.004 to 0.0034
2. Fixed reading images other then 16fp in ApplyModel script
3. Fixed training images corruption on Mac
4. Removed Debug flag to reduce clutter in Flame console

---

<div class="post-metadata">

**Author:** ![ALan](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@ALan](https://forum.logik.tv/u/ALan)\
**Post date:** [January 22, 2024, 7:50am UTC](https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800/24 "2024-01-22T07:50:33Z")

</div>

How about that screen record demo?

---

<div class="post-metadata">

**Author:** ![Ton](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/ton/32/5542_2.png) [@Ton](https://forum.logik.tv/u/Ton)\
**Post date:** [January 22, 2024, 8:41am UTC](https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800/25 "2024-01-22T08:41:26Z")

</div>

This is awesome!! Quick question… I managed to train a model, easy enough… now I’m wondering if I can use other/ external checkpoints from the likes of hugginface et al… guessing I can’t, can I?

> [@talosh](#):
>
> …lect it from menu and navigate to that folder to load it. It is possible to use “F1 / F4” to see before / after.This is a very first release and I’ve been testing it mostly on linux with Flame 2023.3 and I gave it some very limited testing on MacMini M2 using Flame 2025 tech preview. It might work on Intel macs if you sort PyTorch and Numpy dependencies out (give me a shout if you would like to try)

---

<div class="post-metadata">

**Author:** ![talosh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/talosh/32/963_2.png) [@talosh](https://forum.logik.tv/u/talosh)\
**Post date:** [January 22, 2024, 11:33am UTC](https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800/26 "2024-01-22T11:33:31Z")

</div>

> [@ALan](#):
>
> How about that screen record demo?

TDLR: Coming hopefully middle of this week

Hi Alan, I’ve actually started with one and then I’ve bumped into something that I would like to address first. Since Timewarp 0.5. I’ve been trying to use Wiretap to pull the actual image data, and it did mostly work. Wiretap is great tool but on the other side it is a bit hardcore and its python bindings didn’t seem to be carefully updated to python3. Also you need to use shared libraries in order to writhe things back and it might mess up workflows where shared libraries are actively used.  
This might change in the future releases but the reality is that (at least here in London) there are many houses running the latest flavours of Flame 2023, sometimes still on Centos7 with Pacsal Nvidia cards, so this sort of setup seem to be a fair baseline in terms of an API.  
Considering this I’ve decided to move away from Wiretap for now and get back to the old model when you have exr’s exported to a folder and the result is imported back.  
Uncompressed exr’s are relatively easy to read and write in pure python so there are no additional dependencies involved and I believe this would make it more robust. It would also make it easier to create a pybox for this to be able to use in right in batch setups.

Therefore I’ve spent some time on moving the code over to the older way of “export” - \> “process” → “import back” workflow and it is almost complete now. I hope I will be able to release a new version with a video at some point this week.

---

<div class="post-metadata">

**Author:** ![talosh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/talosh/32/963_2.png) [@talosh](https://forum.logik.tv/u/talosh)\
**Post date:** [January 22, 2024, 11:37am UTC](https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800/27 "2024-01-22T11:37:20Z")

</div>

> [@Ton](#):
>
> if I can use other/ external checkpoints from the likes of hugginface et al… guessing I can’t, can I?

Whilst this tool is in its very early stage of development it is build in the way that one should be able to integrate other models. There are models folder and it should be possible to adopt the code so in can be picked up by the tool in the same way. I’m planning to add two more flavours of the model soon and if you have something particular you would like to bring in and willing to code a bit DM me

---

<div class="post-metadata">

**Author:** ![talosh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/talosh/32/963_2.png) [@talosh](https://forum.logik.tv/u/talosh)\
**Post date:** [January 24, 2024, 11:15am UTC](https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800/28 "2024-01-24T11:15:42Z")

</div>

Hi guys, here is a new version of flameSimpleML:

[https://github.com/talosh/flameSimpleML/releases/tag/v0.0.3](https://github.com/talosh/flameSimpleML/releases/tag/v0.0.3)

Here is a video with a walk through the process (sorry for a late night mumbling in broken English):  
[https://vimeo.com/905784396?share=copy](https://vimeo.com/905784396?share=copy)

Main change is that it does not use Wiretap and Shared Libraries and works by exporting uncompressed exrs, processing them and importing back to Flame. It is possible now to train and apply models using several clips as input (for example Front / Back / Matte scenarios). There’s also a little addition that would help to export dataset for training.

While training the main parameter to play with is a Learning Rate: it is possible to adjust it with --lr argument in the command line. It is also possible to pick already trained model data and continue training with --model\_path. Please run train.py it with --help to explore the options.

In light of the recent discussions about ML tools and licensing - there is a license file that contains the licenses of the components used in the tool and not included in Autodesk python distribution bundled with Flame. As far as I’m aware those licenses are fully permissive. Additionally, it’s important to note that no pre-trained data of any kind is included. This should help facilities with reviewing the tool and determining its compliance with their policies.

Give it a try, let me know if it works for you and please give suggestions on how to improve an overall user experience.

---

<div class="post-metadata">

**Author:** ![wiltonmts](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/wiltonmts/32/376_2.png) [@wiltonmts](https://forum.logik.tv/u/wiltonmts)\
**Post date:** [January 24, 2024, 11:41am UTC](https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800/29 "2024-01-24T11:41:21Z")

</div>

Thanks @talosh I was waiting for this demo. Great job.

---

<div class="post-metadata">

**Author:** ![TimC](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/timc/32/11881_2.png) [@TimC](https://forum.logik.tv/u/TimC)\
**Post date:** [January 24, 2024, 1:46pm UTC](https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800/30 "2024-01-24T13:46:59Z")

</div>

here’s the color match / LUT generator @fredwarren !!! 🙂 🙂

amazing stuff @talosh can’t wait to see what others do with it!

---

<div class="post-metadata">

**Author:** ![ALan](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@ALan](https://forum.logik.tv/u/ALan)\
**Post date:** [January 24, 2024, 3:06pm UTC](https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800/31 "2024-01-24T15:06:08Z")

</div>

@talosh  
This is amazing. Would the training take advantage of multi-GPUs on Linux? Also, what about multi-machine training? This would be very cool to be able to submit as a Job on Backburner and have the whole farm crank on this.

---

<div class="post-metadata">

**Author:** ![talosh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/talosh/32/963_2.png) [@talosh](https://forum.logik.tv/u/talosh)\
**Post date:** [January 24, 2024, 3:12pm UTC](https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800/32 "2024-01-24T15:12:04Z")

</div>

Hi Alan, at the moment you can select a GPU to train on, though multi-gpu training can be implemented relatively easily, there’s a pytorch framework for this. Not sure about multi-machine options though

---

<div class="post-metadata">

**Author:** ![ALan](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@ALan](https://forum.logik.tv/u/ALan)\
**Post date:** [January 24, 2024, 3:18pm UTC](https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800/33 "2024-01-24T15:18:41Z")

</div>

That would be great. I can see setting up a machine with multiple cheap data center GPUs to offload training. I have like 6 P40s on a shelf.

> [@talosh](#):
>
> multi-gpu training can be implemented relatively easily

---

<div class="post-metadata">

**Author:** ![cnoellert](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/cnoellert/32/559_2.png) [@cnoellert](https://forum.logik.tv/u/cnoellert)\
**Post date:** [January 24, 2024, 8:10pm UTC](https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800/34 "2024-01-24T20:10:17Z")

</div>

> [@talosh](#):
>
> …n distribution bundled with Flame. As far as I’m aware those licenses are fully permissive. Additionally, it’s important to note that no pre-trained data of any kind is included. This should help facilities with reviewing the tool and determining its compliance with their policies.Give it a try, let me know if it works for you and please give suggestions on how to improve an overall user experience.

Legend.

---

<div class="post-metadata">

**Author:** ![cnoellert](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/cnoellert/32/559_2.png) [@cnoellert](https://forum.logik.tv/u/cnoellert)\
**Post date:** [January 24, 2024, 9:47pm UTC](https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800/35 "2024-01-24T21:47:22Z")

</div>

> [@talosh](#):
>
> …n distribution bundled with Flame. As far as I’m aware those licenses are fully permissive. Additionally, it’s important to note that no pre-trained data of any kind is included. This should help facilities with reviewing the tool and determining its compliance with their policies.Give it a try, let me know if it works for you and please give suggestions on how to improve an overall user experience.

Hey @talosh on first run I’m getting:

```auto
/opt/Autodesk/shared/python/flameSimpleML/packages/.lib/python3.10/site-packages/torch/cuda/ __init__.py:146: UserWarning: 
NVIDIA RTX A5000 with CUDA capability sm_86 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70.
If you want to use the NVIDIA RTX A5000 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

```

and later a little…

```auto
RuntimeError: CUDA error: no kernel image is available for execution on the device
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

```

…and so the fun begins. Any thoughts before I go down the “Start Locally” rabbit hole?

---

<div class="post-metadata">

**Author:** ![talosh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/talosh/32/963_2.png) [@talosh](https://forum.logik.tv/u/talosh)\
**Post date:** [January 24, 2024, 10:34pm UTC](https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800/36 "2024-01-24T22:34:30Z")

</div>

Pytorch bundled with flameSimpleML is too old for this GPU, it has to be updated, some info is here: [https://github.com/talosh/flameTimewarpML/issues/87](https://github.com/talosh/flameTimewarpML/issues/87)

Dm me if needed

---

<div class="post-metadata">

**Author:** ![cnoellert](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/cnoellert/32/559_2.png) [@cnoellert](https://forum.logik.tv/u/cnoellert)\
**Post date:** [January 24, 2024, 11:09pm UTC](https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800/37 "2024-01-24T23:09:32Z")

</div>

All good fam. We’re off to the races.

---

<div class="post-metadata">

**Author:** ![ALan](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@ALan](https://forum.logik.tv/u/ALan)\
**Post date:** [January 25, 2024, 12:57am UTC](https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800/38 "2024-01-25T00:57:30Z")

</div>

Why not just add the latest version to your repo?

> [@talosh](#):
>
> Pytorch bundled with flameSimpleML is too old for this GPU, it has to be updated

---

<div class="post-metadata">

**Author:** ![cnoellert](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/cnoellert/32/559_2.png) [@cnoellert](https://forum.logik.tv/u/cnoellert)\
**Post date:** [January 25, 2024, 1:15am UTC](https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800/39 "2024-01-25T01:15:26Z")

</div>

> [@TimC](#):
>
> here’s the color match / LUT generator can’t wait to see what others do with it!

That was the first thing I ran. Let it run 40 epochs and then killed it. Works a fucking treat… I do wish the inference render was a pybox though so we could use it inline but this is amazing regardless.

---

<div class="post-metadata">

**Author:** ![talosh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/talosh/32/963_2.png) [@talosh](https://forum.logik.tv/u/talosh)\
**Post date:** [January 25, 2024, 7:26am UTC](https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800/40 "2024-01-25T07:26:00Z")

</div>

> [@cnoellert](#):
>
> I do wish the inference render was a pybox

That should be possible, don’t have much experience with pybox but as long as it can give an uncompressed exr it should be pretty straightforward to implement

[Previous page](https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800.md?page=1)

[Next page](https://forum.logik.tv/t/flamesimpleml-flame-machine-learning-source-target-tool-with-bespoke-training/9800.md?page=3)
