Flame Machine Learning Timewarp, now on Linux and Mac

Has anyone had any success running it on a new M2 MBP running Ventura?

Yes! It runs on the M2 MPB running Ventura. You need to use flameTimewarpML-macos.v0.4.3 - and it runs VERY SLOW. Not optimized for Apple Silicon.

I’m getting almost 20sec/frame rendering for a 50% slowdown on HD footage.

oh cool! did you have to do anything special with the install? I went through the automated process but ended up having to install Torch and some other libraries myself and it still isn’t working because of the defunct OPENEXR support

Hey all - another TWML question! I’m trying to use on a Flare on Linux. I can select parameters within Flare fine and it launches the window requesting speed, resolution, export folder etc but when I hit ‘create’ it writes the source out to a source folder, then the processing window flashes up very briefly but it doesn’t actually create the TW - not in the export folder nor back inside Flare. Any thoughts?

1 Like

I actually downloaded the TWML from github and dropped it in /opt/Autodesk/shared/python - I didn’t use the portal.

When you get to gihub, the releases should be on the right side of the page. Make sure to get the 0.4.3 release.

GitHub - talosh/flameTimewarpML: Flame Machine Learning Timewarp. based on arXiv2020-RIFE

@SimonD Have you got any spaces in the destination file path? If so remove or replace them.

Thanks - saw that one further up the thread but alas no spaces to remove

I don’t have an access to Apple silicon machine with flame at the moment but there is a metal backend for pytorch starting with version 1.2.1 and it should run on Intel or AMD versions of MacOS.

I’m trying to re-work the script now so it runs within the flame fully, but in the meantime those who want to experiment with metal can try addin newer verson of pytorch and then in the inference scripts try to change cuda to mps. More info on that here:

https://pytorch.org/docs/stable/notes/mps.html

and here:

You might need to install Miniconda compiled for apple silicon as well

Give me a shout if you want to experiment and we can get in touch

5 Likes

Hi Talosh!

I just re-read my post and I’m really sorry if it came across that I’m not immensely grateful for your script!! It’s genuinely amazing, I’m just complaining the fact that I don’t have a linux machine to run it. I do run it on my M2, and it does get the job done.

I would LOVE to experiment with you and help figure out the Mac version and what’s needed.

Thanks Talosh! for this note and for making this whole thing!

Hey folks, and hey @talosh !
Still loving TWML.
Just tried to get it running on my McStudio (macOS 13.2 / Flame 2024) but I’m getting this error:

/bin/bash: /Users/chriskasten_macstudio/Documents/flameTimewarpML/miniconda3/bin/conda: No such file or directory
/bin/bash: conda: command not found
Traceback (most recent call last):
  File "/Users/chriskasten_macstudio/Documents/flameTimewarpML/bundle/inference_flame_tw.py", line 5, in <module>
    import cv2
ModuleNotFoundError: No module named 'cv2'

I’m so bad when it comes to command lines that I don’t know what to do here.
May I ask for help?

Big hugs! <3

Hey Chris!

TWML cannot find your conda environment where it expects it to be.
It’s either not installed properly or maybe a permission issue.
Does that directory exist?

If yes, open a terminal and type:

cd /Users/chriskasten_macstudio/Documents/flameTimewarpML/miniconda3/bin/

hit enter

ls -la

hit enter

And let’s see how the permissions look like.

1 Like

Hey Claus <3

minicoda3 folder was missing.
I’ve done a fresh install with everything but it’s still missing.
Doing ls -la on the folder flameTimewarpML I get the following:

drwxrwxrwx@  5 chriskasten_macstudio  staff  160 17 Mai 11:38 .
drwx------+ 10 chriskasten_macstudio  staff  320 17 Mai 11:38 ..
drwxrwxrwx  24 chriskasten_macstudio  staff  768 17 Mai 11:38 bundle
-rw-rw-rw-   1 chriskasten_macstudio  staff  151 17 Mai 11:38 miniconda_install.log
-rw-rw-rw-   1 chriskasten_macstudio  staff  324 17 Mai 11:38 miniconda_packages_install.log

What does the log say? Any helpful hints what went wrong in here?

Two terminals show up when unpacking TWML:

Terminal 1:

[flameTimewarpML] [flameAppFramework] waking up
[flameTimewarpML] unable to load preferences from /Users/chriskasten_macstudio/Library/Preferences/flameTimewarpML/ChrissMacStudio.fritz.box/flameTimewarpML.CHRIS_2024.230504_Sauvage_HM.prefs
[flameTimewarpML] [Errno 2] No such file or directory: '/Users/chriskasten_macstudio/Library/Preferences/flameTimewarpML/ChrissMacStudio.fritz.box/flameTimewarpML.CHRIS_2024.230504_Sauvage_HM.prefs'
[flameTimewarpML] unable to load preferences from /Users/chriskasten_macstudio/Library/Preferences/flameTimewarpML/ChrissMacStudio.fritz.box/flameTimewarpML.CHRIS_2024.prefs
[flameTimewarpML] [Errno 2] No such file or directory: '/Users/chriskasten_macstudio/Library/Preferences/flameTimewarpML/ChrissMacStudio.fritz.box/flameTimewarpML.CHRIS_2024.prefs'
[flameTimewarpML] unable to load preferences from /Users/chriskasten_macstudio/Library/Preferences/flameTimewarpML/ChrissMacStudio.fritz.box/flameTimewarpML.prefs
[flameTimewarpML] [Errno 2] No such file or directory: '/Users/chriskasten_macstudio/Library/Preferences/flameTimewarpML/ChrissMacStudio.fritz.box/flameTimewarpML.prefs'
[flameTimewarpML] script file: /opt/Autodesk/shared/python/flameTimewarpML.pyPYTHON: flameTimewarpML initializing

Could not remove temporary library '_Export_230509_155350' associated to job 'Export - H&M_01_0010A_v001_Stillframe_Layout_comp_flm_v001 (15.53.50)': Could not find library '_Export_230509_155350'..
[flameTimewarpML] bundle_id: e0e0ddbebf6ea69f75a929b2849aa8c3d263db8e size 397Mb
[flameTimewarpML] creating new bundle folder: /Users/chriskasten_macstudio/Documents/flameTimewarpML/bundle
[flameTimewarpML] unpacking payload: /Users/chriskasten_macstudio/Documents/flameTimewarpML/flameTimewarpML.v0.4.4.dev.015.bundle.tar
Could not remove temporary library '_Export_230509_155425' associated to job 'Export - H&M_01_0010A_v001_Stillframe_Layout_comp_flm_v001_Rec709Daily (15.54.26)': Could not find library '_Export_230509_155425'..
Could not remove temporary library '_Export_230509_161543' associated to job 'Export - H&M_01_0010A_v001_Stillframe_Layout_comp_flm_v001_Offlineframing (16.15.43)': Could not find library '_Export_230509_161543'..
Could not remove temporary library '_Export_230509_161609' associated to job 'Export - H&M_01_0010A_v001_Stillframe_Layout_comp_flm_v001_Offlineframing_Rec709Dail (16.16.09)': Could not find library '_Export_230509_161609'..
Could not remove temporary library '_Export_230511_121212' associated to job 'Export - H&M_01_0010A_v001 (12.12.12)': Could not find library '_Export_230511_121212'..
Could not remove temporary library '_Export_230516_151102' associated to job 'Export - HM_B2SCH_FILM_1_15s_v6B_UHD_LogC4-AWG4_denoised_mute_230516CK1500FL (15.11.02)': Could not find library '_Export_230516_151102'..
[flameTimewarpML] Executing command: tar xf "/Users/chriskasten_macstudio/Documents/flameTimewarpML/flameTimewarpML.v0.4.4.dev.015.bundle.tar" -C "/Users/chriskasten_macstudio/Documents/flameTimewarpML/"
[flameTimewarpML] exit status 0
[flameTimewarpML] bundle extracted to /Users/chriskasten_macstudio/Documents/flameTimewarpML/bundle
[flameTimewarpML] extracting bundle took 1.0 sec
[flameTimewarpML] installing Miniconda3...
[flameTimewarpML] installing into /Users/chriskasten_macstudio/Documents/flameTimewarpML/miniconda3
[flameTimewarpML] Executing command: /bin/sh "/Users/chriskasten_macstudio/Documents/flameTimewarpML/bundle/miniconda.package/Miniconda3-latest-MacOSX-x86_64.sh" -b -p "/Users/chriskasten_macstudio/Documents/flameTimewarpML/miniconda3" 2>&1 | tee > /Users/chriskasten_macstudio/Documents/flameTimewarpML/miniconda_install.log
[flameTimewarpML] exit status 0
[flameTimewarpML] installing Miniconda took 0.0 sec
[flameTimewarpML] installing Miniconda packages...
[flameTimewarpML] Executing command: /bin/bash -c 'eval "$(/Users/chriskasten_macstudio/Documents/flameTimewarpML/miniconda3/bin/conda shell.bash hook)"; conda activate; pip3 install -r /Users/chriskasten_macstudio/Documents/flameTimewarpML/bundle/requirements.txt --no-index --find-links /Users/chriskasten_macstudio/Documents/flameTimewarpML/bundle/miniconda.package/packages 2>&1 | tee > /Users/chriskasten_macstudio/Documents/flameTimewarpML/miniconda_packages_install.log'
/bin/bash: /Users/chriskasten_macstudio/Documents/flameTimewarpML/miniconda3/bin/conda: No such file or directory
/bin/bash: conda: command not found
[flameTimewarpML] exit status 0
[flameTimewarpML] installing Miniconda packages took 0.3 sec
[flameTimewarpML] flameTimewarpML has finished unpacking its bundle and installing required packages
[flameTimewarpML] cleaning up /Users/chriskasten_macstudio/Documents/flameTimewarpML/flameTimewarpML.v0.4.4.dev.015.bundle.tar
[flameTimewarpML] Executing command: rm -rf "/Users/chriskasten_macstudio/Documents/flameTimewarpML/bundle/miniconda.package"
[flameTimewarpML] removing bundle from script file

Terminal 2

Last login: Wed May 17 11:52:31 on ttys004
tail -f /var/tmp/flameTimewarpML_install.log; exit                              
chriskasten_macstudio@ChrissMacStudio ~ % tail -f /var/tmp/flameTimewarpML_install.log; exit
[flameTimewarpML] bundle_id: e0e0ddbebf6ea69f75a929b2849aa8c3d263db8e size 397Mb
[flameTimewarpML] creating new bundle folder: /Users/chriskasten_macstudio/Documents/flameTimewarpML/bundle
[flameTimewarpML] unpacking payload: /Users/chriskasten_macstudio/Documents/flameTimewarpML/flameTimewarpML.v0.4.4.dev.015.bundle.tar
[flameTimewarpML] Executing command: tar xf "/Users/chriskasten_macstudio/Documents/flameTimewarpML/flameTimewarpML.v0.4.4.dev.015.bundle.tar" -C "/Users/chriskasten_macstudio/Documents/flameTimewarpML/"
[flameTimewarpML] exit status 0
[flameTimewarpML] bundle extracted to /Users/chriskasten_macstudio/Documents/flameTimewarpML/bundle
[flameTimewarpML] extracting bundle took 1.0 sec
[flameTimewarpML] installing Miniconda3...
[flameTimewarpML] installing into /Users/chriskasten_macstudio/Documents/flameTimewarpML/miniconda3
[flameTimewarpML] Executing command: /bin/sh "/Users/chriskasten_macstudio/Documents/flameTimewarpML/bundle/miniconda.package/Miniconda3-latest-MacOSX-x86_64.sh" -b -p "/Users/chriskasten_macstudio/Documents/flameTimewarpML/miniconda3" 2>&1 | tee > /Users/chriskasten_macstudio/Documents/flameTimewarpML/miniconda_install.log
[flameTimewarpML] exit status 0
[flameTimewarpML] installing Miniconda took 0.0 sec
[flameTimewarpML] installing Miniconda packages...
[flameTimewarpML] Executing command: /bin/bash -c 'eval "$(/Users/chriskasten_macstudio/Documents/flameTimewarpML/miniconda3/bin/conda shell.bash hook)"; conda activate; pip3 install -r /Users/chriskasten_macstudio/Documents/flameTimewarpML/bundle/requirements.txt --no-index --find-links /Users/chriskasten_macstudio/Documents/flameTimewarpML/bundle/miniconda.package/packages 2>&1 | tee > /Users/chriskasten_macstudio/Documents/flameTimewarpML/miniconda_packages_install.log'
[flameTimewarpML] exit status 0
[flameTimewarpML] installing Miniconda packages took 0.3 sec
[flameTimewarpML] flameTimewarpML has finished unpacking its bundle and installing required packages
zsh: terminated  tail -f /var/tmp/flameTimewarpML_install.log

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Prozess beendet]

Sorry - didn’t noticed that you’re asking for this specific Log.

Here it says:

/bin/sh: /Users/chriskasten_macstudio/Documents/flameTimewarpML/bundle/miniconda.package/Miniconda3-latest-MacOSX-x86_64.sh: No such file or directory

And in fact. That’s missing.

I’ve never used the automatic installer, but it looks like fails to install Miniconda, as the install script is not found.

Maybe have a look here to install it manually:

download Miniconda from here:
https://docs.conda.io/en/latest/miniconda.html

But that also means you have to install all the dependencies from the requirements file via pip.
This will probably all work, but I have no idea, how to do this in a one-click-no-comandline-needed-manner. :confused:

1 Like

Hi guys, I’ve just got the very first version working with Wiretap and Metal backend on Mac. The first head-to-head Metal vs CPU speed processing test did show about 50% speed improvement - it is still way slower then Cuda on Linux but still something. Frames are being read directly from framestore and being saved in a new clip over wiretap as well. I’m testing it on old Intel mac with 8Gb AMD card and I hope I can do some tests on Apple silicon as well. So far memory usage seem to be quite moderate with processing 3,5K clip taking about 2.5Gig of GPU ram.

Here is a little video that has been speed up at 10x:

https://vimeo.com/834194220?share=copy

Those interested in code and collaboration please have a look into Dev branch on

20 Likes

Awesome!! Can’t wait to try on my macstudio. Thank you!!!

How can it be installed? Both scripts flameTimewarpML.py and flameTimewarpML.v0.4.4.py dont work.