apple/ml-depth-pro

MACOS run error: RuntimeError: "compute_indices_weights_linear" not implemented for 'Half'

Opened this issue · 0 comments

there is an error on MACOS:
ml-depth-pro % depth-pro-run -i ./data/example.jpg
0%| | 0/1 [00:00<?, ?it/s]/opt/anaconda3/envs/depth-pro/lib/python3.9/site-packages/torch/nn/functional.py:4038: UserWarning: MPS: passing scale factor to upsample ops is supported natively starting from macOS 13.0. Falling back on CPU. This may have performance implications. (Triggered internally at /Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/UpSample.mm:246.)
return torch._C._nn.upsample_bilinear2d(input, output_size, align_corners, scale_factors)
0%| | 0/1 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/opt/anaconda3/envs/depth-pro/bin/depth-pro-run", line 8, in
sys.exit(run_main())
File "/Volumes/T7Touch/workspace-python/ml-depth-pro/src/depth_pro/cli/run.py", line 145, in main
run(parser.parse_args())
File "/Volumes/T7Touch/workspace-python/ml-depth-pro/src/depth_pro/cli/run.py", line 68, in run
prediction = model.infer(transform(image), f_px=f_px)
File "/opt/anaconda3/envs/depth-pro/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/Volumes/T7Touch/workspace-python/ml-depth-pro/src/depth_pro/depth_pro.py", line 281, in infer
canonical_inverse_depth, fov_deg = self.forward(x)
File "/Volumes/T7Touch/workspace-python/ml-depth-pro/src/depth_pro/depth_pro.py", line 233, in forward
encodings = self.encoder(x)
File "/opt/anaconda3/envs/depth-pro/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/opt/anaconda3/envs/depth-pro/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "/Volumes/T7Touch/workspace-python/ml-depth-pro/src/depth_pro/network/encoder.py", line 248, in forward
x0, x1, x2 = self._create_pyramid(x)
File "/Volumes/T7Touch/workspace-python/ml-depth-pro/src/depth_pro/network/encoder.py", line 159, in _create_pyramid
x1 = F.interpolate(
File "/opt/anaconda3/envs/depth-pro/lib/python3.9/site-packages/torch/nn/functional.py", line 4038, in interpolate
return torch._C._nn.upsample_bilinear2d(input, output_size, align_corners, scale_factors)
RuntimeError: "compute_indices_weights_linear" not implemented for 'Half'

Hardware:
OS: macOS Monterey 12.3.1
iMac (Retina 5K, 27-inch, 2020)
cpu:3.3 GHz 六核Intel Core i5
ram: 72 GB 2667 MHz DDR4
gpu: AMD Radeon Pro 5300 4 GB