Needs a little modification to run on M1Mac.
autumnmotor opened this issue · 4 comments
hi.
I've tried ifacialmocap_puppeteer.py and manual_poser.py and they are very interesting!
It's cool to be able to move a single picture like this without the complicated setup of Live2D!
By the way, I tried running this script on my M1Mac, but it required some modifications to the source.
First, since M1Mac does not support cuda,
if name == "main":
...
device = torch.device('cuda')
to
device = torch.device('cpu')
I had to change it to
M1Mac should support "torch.device('mps')", but in this case, in the update_images method
output_image = self.poser.pose(self.torch_source_image, pose, output_index)
I am getting an error at the above location.
Loading the eyebrow decomposer ... DONE!!!
Loading the eyebrow morphing conbiner ... DONE!!!
Loading the face morpher ... DONE!!!
Loading the face-body rotator ... DONE!!!
Loading the combiner ... DONE!!!
loc("mps_scatter_along_axis"("(mpsFileLoc): /AppleInternal/Library/BuildRoots/2d9b4df9-4b93-11ed->b0fc-2e32217d8374/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShadersGraph/mpsgraph/>MetalPerformanceShadersGraph/Core/Files/MPSGraphUtilities.mm":350:0)): error: invalid input tensor >shapes, indices shape and updates shape must be equal
/AppleInternal/Library/BuildRoots/2d9b4df9-4b93-11ed-b0fc-2e32217d8374/Library/Caches/com.apple.xbs/>Sources/MetalPerformanceShadersGraph/mpsgraph/MetalPerformanceShadersGraph/Core/Files/>MPSGraphExecutable.mm:1584: failed assertion `Error: MLIR pass manager failed'
/opt/homebrew/Caskroom/miniconda/base/envs/talking-head-anime-3-demo/bin/pythonw: line 3: 15381 >Abort trap: 6 /opt/homebrew/Caskroom/miniconda/base/envs/talking-head-anime-3-demo/>python.app/Contents/MacOS/python "$@"
So I had to choose torch.device('cpu').
Also, regarding the --model argument,
standard_float, separable_float worked, but standard_half, separable_half did not work with the following error.
/python3.8/site-packages/torch/nn/modules/conv.py", line 459, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
RuntimeError: "slow_conv2d_cpu" not implemented for 'Half'
I've also encountered other programs using pytorch, but half (float16?) doesn't seem to work on M1Mac for now.
Anyway, the fix above worked. Of course, the speed is slow because the CPU is specified as the device, but I feel there is a lot of potential.
Thank you for publishing such a wonderful project!
Translated from Japanese to English by Google.
Thank you for reading my poor English!
Thank you for your comment. I'll leave the thread here for others who might want to run this on a Mac.
I found the solution, you should install the preview(nightly) version of pyTorch:
$ conda install pytorch torchvision torchaudio -c pytorch-nightly
Then simply change cuda
into mps
here:
When using cpu version, the fps was only 1; after using mps version, it increases to about 10 fps, which is more like an animation.
Thanks for the thread. I installed it successfully on my M1 MAC.
Just a friendly reminder that don't forget to change python
into pythonw
while executing
> python tha3/app/manual_poser.py
or other python
command
Thanks for the thread. I installed it successfully on my M1 MAC. Just a friendly reminder that don't forget to change
python
intopythonw
while executing> python tha3/app/manual_poser.py
or otherpython
command
is it possible to run it in windows using cpu ? pls reply