OpenGVLab / DragGAN

Unofficial Implementation of DragGAN - "Drag Your GAN: Interactive Point-based Manipulation on the Generative Image Manifold" (DragGAN 全功能实现,在线Demo,本地部署试用,代码、模型已全部开源,支持Windows, macOS, Linux)
5k stars 491 forks source link

m1pro 安装完启动时报错 #95

Open oldfishoh opened 1 year ago

oldfishoh commented 1 year ago
image
paulluuk commented 1 year ago

Try running this in CLI:

export PYTORCH_ENABLE_MPS_FALLBACK=1
python gradio_app.py --device mps
oldfishoh commented 1 year ago

Try running this in CLI:

export PYTORCH_ENABLE_MPS_FALLBACK=1
python gradio_app.py --device mps

Loading networks from "/Users/laoyu/draggan/checkpoints-pkl/ada/afhqcat.pkl"... Registering hook for: b256 _imported_module_1af704f46e18456fb60d0bfa9754f9e9:240: UserWarning: The operator 'aten::lerp.Scalar_out' is not currently supported on the MPS backend and will fall back to run on the CPU. This may have performance implications. (Triggered internally at /Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/mps/MPSFallback.mm:11.) Registering hook for: b256 Traceback (most recent call last): File "gradio_app.py", line 317, in demo = main() File "gradio_app.py", line 249, in main img, F0 = draggan.generate_image(W, G, device=device) File "/Users/laoyu/Documents/code/DragGAN/draggan/draggan.py", line 181, in generate_image img, features = forward_G(G, W, device) File "/Users/laoyu/Documents/code/DragGAN/draggan/draggan.py", line 138, in forward_G img = G.synthesis(W, noise_mode="const", force_fp32=True) File "/Users/laoyu/miniconda3/envs/draggan/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, kwargs) File "", line 463, in forward File "/Users/laoyu/miniconda3/envs/draggan/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, *kwargs) File "", line 397, in forward File "/Users/laoyu/miniconda3/envs/draggan/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(input, kwargs) File "", line 292, in forward File "/Users/laoyu/Documents/code/DragGAN/draggan/stylegan2/torch_utils/misc.py", line 101, in decorator return fn(*args, kwargs) File "", line 72, in modulated_conv2d File "/Users/laoyu/Documents/code/DragGAN/draggan/stylegan2/torch_utils/misc.py", line 101, in decorator return fn(args, kwargs) File "/Users/laoyu/Documents/code/DragGAN/draggan/stylegan2/torch_utils/ops/conv2d_resample.py", line 139, in conv2d_resample x = upfirdn2d.upfirdn2d(x=x, f=f, padding=[px0+pxt,px1+pxt,py0+pyt,py1+pyt], gain=up2, flip_filter=flip_filter) File "/Users/laoyu/Documents/code/DragGAN/draggan/stylegan2/torch_utils/ops/upfirdn2d.py", line 164, in upfirdn2d return _upfirdn2d_ref(x, f, up=up, down=down, padding=padding, flip_filter=flip_filter, gain=gain) File "/Users/laoyu/Documents/code/DragGAN/draggan/stylegan2/torch_utils/misc.py", line 101, in decorator return fn(args, kwargs) File "/Users/laoyu/Documents/code/DragGAN/draggan/stylegan2/torch_utils/ops/upfirdn2d.py", line 185, in _upfirdn2d_ref x = torch.nn.functional.pad(x, [0, upx - 1, 0, 0, 0, upy - 1]) TypeError: Cannot convert a float64 Tensor to MPS as the MPS framework doesn't support float64. Please use float32 instead.