Flame Machine Learning Timewarp, now on Linux and Mac

force is with us

4 Likes

Hello :slight_smile:
Python script installed
Flame 2021
Mac OS High Sierra
No Cuda GPU inside

I tried any of the Timewarp ML but it seems to have a pb.
Is there any solution to run this script on my mac ?

Terminal log :
"inference_flame_tw.py: error: unrecognized arguments: SLOMO ML/..."

Thank you
Shiver

1 Like

Thesre should be more to that line could you send whiole msg?

1 Like
usage: inference_fluidmorph.py [-h] [--incoming INCOMING]
                               [--outgoing OUTGOING] [--output OUTPUT]
                               [--model MODEL] [--UHD] [--cpu] [--curve CURVE]
inference_fluidmorph.py: error: unrecognized arguments: FLUID MORPH/TRANSITION_FLUIDMORPH_ML_PART_1_FLUID_2021JAN30_0837_F1B/incoming FLUID MORPH/TRANSITION_FLUIDMORPH_ML_PART_1_FLUID_2021JAN30_0837_F1B/outgoing FLUID MORPH/TRANSITION_FLUIDMORPH_ML_PART_1_FLUID_2021JAN30_0837_F1B
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Opération terminée]
2 Likes

Looks like it does not like spaces in target folder… This is something that should be fixed in next reease. Could you try choosing a folder without spaces in the meantime?

3 Likes

Exact !
Thank you Talosh, it works pretty well !
Just an issue, the sequences are in 24 fps but the result of fluidmorph ML is 25fps.

1 Like

I think it just follows the project settings, there’s nothing the code is doing at the moment in terms of setting the framerate, but it is a good point, I’ll have a look if it is generally possible to query it and set from python on import

1 Like

I seem to be experiencing some install troubles… after 5 minutes or so of the install I’m still sitting on this screen…??

Output log to: ‘/opt/Autodesk/log/slateDiskCacheCleaner.log’.

Registered thread ‘CoAsyncLogger’ [ 123145558724608 ]

Connected to DLmpd on 127.0.0.1 as 0:0

Connected to DLmpd on 127.0.0.1 as 0:20

Registered thread ‘CoDiskCache Cache Clean-Up Thread’ [ 123145559785472 ]

Bmd Audio : ERROR applying the interface: Bmd error for Cannot get audio input value.: (

[flameTimewarpML] [flameAppFramework] waking up

[flameTimewarpML] preferences loaded from /Users/randymcentee/Library/Preferences/flameTimewarpML/dxs-flame-01/flameTimewarpML.randy_3.J21999_Renderdome.prefs

[flameTimewarpML] preferences loaded from /Users/randymcentee/Library/Preferences/flameTimewarpML/dxs-flame-01/flameTimewarpML.randy_3.prefs

[flameTimewarpML] preferences loaded from /Users/randymcentee/Library/Preferences/flameTimewarpML/dxs-flame-01/flameTimewarpML.prefs

[flameTimewarpML] script file: /opt/Autodesk/shared/python/flameTimewarpML-macos.v0.3.0/flameTimewarpML.py

PYTHON : flameTimewarpML initializing

Python encountered ‘\nUsage: python primaries transfer matrix gamma /path/to/mov\n’ in unknown code

[PYTHON HOOK] An error occurred Igoring python hooks from /opt/Autodesk/shared/python/nclc_mediahub/nclc.py

[flameTimewarpML] bundle_id: 65df23be03066d189419b6164b3a0e12f96c2887 size 516Mb

[flameTimewarpML] creating new bundle folder: /Users/randymcentee/Documents/flameTimewarpML/bundle

[flameTimewarpML] unpacking payload: /Users/randymcentee/Documents/flameTimewarpML/bundle.tar

[flameTimewarpML] Executing command: tar xf /Users/randymcentee/Documents/flameTimewarpML/bundle.tar -C /Users/randymcentee/Documents/flameTimewarpML/

[flameTimewarpML] exit status 0

[flameTimewarpML] cleaning up /Users/randymcentee/Documents/flameTimewarpML/bundle.tar

[flameTimewarpML] bundle extracted to /Users/randymcentee/Documents/flameTimewarpML/bundle

[flameTimewarpML] extracting bundle took 2.84754514694 sec

[flameTimewarpML] installing Miniconda3…

[flameTimewarpML] installing into /Users/randymcentee/Documents/flameTimewarpML/miniconda3

[flameTimewarpML] Executing command: /bin/sh /Users/randymcentee/Documents/flameTimewarpML/bundle/miniconda.package/Miniconda3-latest-MacOSX-x86_64.sh -b -p /Users/randymcentee/Documents/flameTimewarpML/miniconda3 2>&1 | tee > /Users/randymcentee/Documents/flameTimewarpML/miniconda_install.log

Looks like it stuck on installing Miniconda3. There might be more info in /Users/randymcentee/Documents/flameTimewarpML/miniconda_install.log on why exactly, if you can have a look there and send it over.
You may as well just remove /Users/randymcentee/Documents/flameTimewarpML folder and run it again. If it doesn’t work it is possible to do this steps manually as well

1 Like

Just tested on imac pro!
Impressive work @talosh

This is greatly improving a weak part of flame.
Thanks a lot for sharing it!

1 Like

So this continues to fail on install…how can I get this installed? It just hangs here…I tried deleting all the scripts in opt/Autodesk/shared/python and all the folders in the /Documents folder to reinstall, and its doing the same thing.

thoughts?
r

Last login: Wed Feb 3 12:36:26 on ttys000
tail -f /var/tmp/flameTimewarpML_install.log; exit
randymcentee@dxs-flame-01 ~ % tail -f /var/tmp/flameTimewarpML_install.log; exit
[flameTimewarpML] bundle_id: 65df23be03066d189419b6164b3a0e12f96c2887 size 516Mb
[flameTimewarpML] creating new bundle folder: /Users/randymcentee/Documents/flameTimewarpML/bundle
[flameTimewarpML] unpacking payload: /Users/randymcentee/Documents/flameTimewarpML/bundle.tar
[flameTimewarpML] Executing command: tar xf /Users/randymcentee/Documents/flameTimewarpML/bundle.tar -C /Users/randymcentee/Documents/flameTimewarpML/
[flameTimewarpML] exit status 0
[flameTimewarpML] cleaning up /Users/randymcentee/Documents/flameTimewarpML/bundle.tar
[flameTimewarpML] bundle extracted to /Users/randymcentee/Documents/flameTimewarpML/bundle
[flameTimewarpML] extracting bundle took 3.18354392052 sec
[flameTimewarpML] installing Miniconda3…
[flameTimewarpML] installing into /Users/randymcentee/Documents/flameTimewarpML/miniconda3
[flameTimewarpML] Executing command: /bin/sh /Users/randymcentee/Documents/flameTimewarpML/bundle/miniconda.package/Miniconda3-latest-MacOSX-x86_64.sh -b -p /Users/randymcentee/Documents/flameTimewarpML/miniconda3 2>&1 | tee > /Users/randymcentee/Documents/flameTimewarpML/miniconda_install.log

Let’s start with installing Miniconda manually - that is the step it seem to get hung on at the moment. There are two installers on Miniconda — Conda documentation - one is a shell script and another one is mac pkg. Could try to install it from pkg into /Users/randymcentee/Documents/flameTimewarpML/miniconda3 folder? There’s an option to install it on specific disk and choose where exactly, but select the top folder (flameTimewarpML) it should create miniconda3 folder within it. Do not delete /Users/randymcentee/Documents/flameTimewarpML/bundle folder, but it is good to empty miniconda3 folder from previous failed install. Give me a shout if it works, and then we’ll need to to install dependency packages and put the bundle id manually

If it installs fine in terminal cd to /Users/randymcentee/Documents/flameTimewarpML/bundle and from there run this sting: /bin/bash --rcfile <(echo ‘. ~/.bashrc; eval “$(…/miniconda3/bin/conda shell.bash hook)”; conda activate’)
this should give the base prefix in fron of the shell, and then if you run python3 --version it should give Python 3.8.5

1 Like

@talosh First of all: THANK YOU!!! Just used v0.3.0 for an unexpected timewarp masacre and your tool saved us a ton of lifetime! <3

Just testing it on a new MacPro and wondering, why only 3 of 32 CPU worker threads are in use…?

Hi Chris, glad it helped! Threads number is relatively easy to adjust.

Each thread will try to allocate some memory based on an image size it has to process. I did a very quick and probably inaccurate measurment on mac and linux and put quite a conservative value to estimate safe number of threads to use - so the whole thing will not put the system down on its knees in terms of memory consumption.

Depending on the actual module you’re using there are four files in ~/Documents/flameTimewarpML/bundle folder: inference_sequence.py, inference_fluidmorph.py, inference_flame_tw.py and inference_dpframes.py. Each of this files have a code block that looks like this:

    max_cpu_workers = mp.cpu_count() - 2
    available_ram = psutil.virtual_memory()[1]/( 1024 ** 3 )
    megapixels = ( h * w ) / ( 10 ** 6 )
    thread_ram = megapixels * 2.4
    sim_workers = round( available_ram / thread_ram )
    if sim_workers < 1:
        sim_workers = 1
    elif sim_workers > max_cpu_workers:
        sim_workers = max_cpu_workers

Here it looks at currently avaliable ram and decides how many threads to use against given image size.
If you want to experiment you may lower the value in the liine:

thread_ram = megapixels * 2.4

It should be safe to bring this value down to 1.9 and probably even lower is possible but watch your memory consumption and swap usage.
If you would like to test it with fixed number of threads just comment out this line:

sim_workers = round( available_ram / thread_ram )

and assign desired number of threads directly like this:

sim_workers = 10

Unfortunately the code is a bit messy and quick’n’dirty so you have to change the value in all four modules. I’ll probably clean it up in the future to get this repetitive code in one place.

Let me know your findings about your sweet spot with memory multiplier value and image resoultion

1 Like

Okay, did all that, successfully installed the Miniconda 3 pkg, and when I go to relaunch. Flame it still tries to install it and gives me the same experience in the shell where it hangs on installing Miniconda 3…

Output log to: ‘/opt/Autodesk/log/slateDiskCacheCleaner.log’.

Registered thread ‘CoAsyncLogger’ [ 123145318670336 ]

Connected to DLmpd on 127.0.0.1 as 0:0

Connected to DLmpd on 127.0.0.1 as 0:20

Registered thread ‘CoDiskCache Cache Clean-Up Thread’ [ 123145319731200 ]

Bmd Audio : ERROR applying the interface: Bmd error for Cannot get audio input value.: (

[flameTimewarpML] [flameAppFramework] waking up

[flameTimewarpML] preferences loaded from /Users/randymcentee/Library/Preferences/flameTimewarpML/dxs-flame-01.local/flameTimewarpML.randy_3.uncomp_test.prefs

[flameTimewarpML] preferences loaded from /Users/randymcentee/Library/Preferences/flameTimewarpML/dxs-flame-01.local/flameTimewarpML.randy_3.prefs

[flameTimewarpML] preferences loaded from /Users/randymcentee/Library/Preferences/flameTimewarpML/dxs-flame-01.local/flameTimewarpML.prefs

[flameTimewarpML] script file: /opt/Autodesk/shared/python/flameTimewarpML-macos.v0.3.0/flameTimewarpML.py

PYTHON : flameTimewarpML initializing

[flameTimewarpML] bundle_id: 65df23be03066d189419b6164b3a0e12f96c2887 size 516Mb

[flameTimewarpML] removing previous backup folder

[flameTimewarpML] Executing command: rm -rf /Users/randymcentee/Documents/flameTimewarpML/bundle.previous

[flameTimewarpML] backing up existing bundle folder

[flameTimewarpML] Executing command: mv /Users/randymcentee/Documents/flameTimewarpML/bundle /Users/randymcentee/Documents/flameTimewarpML/bundle.previous

[flameTimewarpML] creating new bundle folder: /Users/randymcentee/Documents/flameTimewarpML/bundle

[flameTimewarpML] unpacking payload: /Users/randymcentee/Documents/flameTimewarpML/bundle.tar

[flameTimewarpML] Executing command: tar xf /Users/randymcentee/Documents/flameTimewarpML/bundle.tar -C /Users/randymcentee/Documents/flameTimewarpML/

[flameTimewarpML] exit status 0

[flameTimewarpML] cleaning up /Users/randymcentee/Documents/flameTimewarpML/bundle.tar

[flameTimewarpML] bundle extracted to /Users/randymcentee/Documents/flameTimewarpML/bundle

[flameTimewarpML] extracting bundle took 3.08322000504 sec

[flameTimewarpML] Executing command: rm -rf /Users/randymcentee/Documents/flameTimewarpML/miniconda3.previous

[flameTimewarpML] Executing command: mv /Users/randymcentee/Documents/flameTimewarpML/miniconda3 /Users/randymcentee/Documents/flameTimewarpML/miniconda3.previous

[flameTimewarpML] installing Miniconda3…

[flameTimewarpML] installing into /Users/randymcentee/Documents/flameTimewarpML/miniconda3

[flameTimewarpML] Executing command: /bin/sh /Users/randymcentee/Documents/flameTimewarpML/bundle/miniconda.package/Miniconda3-latest-MacOSX-x86_64.sh -b -p /Users/randymcentee/Documents/flameTimewarpML/miniconda3 2>&1 | tee > /Users/randymcentee/Documents/flameTimewarpML/miniconda_install.log

when you run it from flame it had probably moved that miniconda3 installation folder that came from pkg install to miniconda3.backup so you might need to restore it.

Then, when you are in this miniconda3 environment (you see (base) in front of the shell, python3 --version gives 3.8.5) do pip3 install -r /Users/randymcentee/Documents/flameTimewarpML/base/requirements.txt

this should download and install needed dep libraries

the last thing is to stamp the bundle by creating id file:
echo 65df23be03066d189419b6164b3a0e12f96c2887 > /Users/randymcentee/Documents/flameTimewarpML/bundle/bundle_id

This should make it happy and when you run flame it should recognize the bundle as installed.

Hoe that will work, let me know how it goes

@talosh . I’m just getting time to play with this today … This is sick mate. Well done and many thanks. -M

1 Like

Tried it on my hackintosh with an RX580, works well.

2 Likes