Type Error with MPS
Author: hyperswineCreated Mar 5, 2023Updated Mar 23, 2024
Im on an M2 apple system version 12.3.1 and Im getting the following error when I try to run texttopointcloud.ipynb with device = torch.device("mps"). Ive tried changing some of the float64 (mostly in gaussian it seems) to float32 but to no effect. Im guessing its probably one of the dependencies
Output exceeds the [size limit](command:workbench.action.openSettings?%5B%22notebook.output.textLineLimit%22%5D). Open the full output data [in a text editor](command:workbench.action.openLargeOutput?be55e8a7-0d71-42c1-837e-be8f9347d533)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[11], line 6
4 # Produce a sample from the model.
5 samples = None
----> 6 for x in tqdm(sampler.sample_batch_progressive(batch_size=1, model_kwargs=dict(texts=[prompt]))):
7 samples = x
File [~/.pyenv/versions/mambaforge-22.9.0-3/lib/python3.10/site-packages/tqdm/std.py:1178](https://file+.vscode-resource.vscode-cdn.net/Users/jasonqin/Documents/GitHub/point-e/point_e/examples/~/.pyenv/versions/mambaforge-22.9.0-3/lib/python3.10/site-packages/tqdm/std.py:1178), in tqdm.__iter__(self)
1175 time = self._time
1177 try:
-> 1178 for obj in iterable:
1179 yield obj
1180 # Update and possibly print the progressbar.
1181 # Note: does not call self.update(1) for speed optimisation.
File [~/.pyenv/versions/mambaforge-22.9.0-3/lib/python3.10/site-packages/point_e/diffusion/sampler.py:163](https://file+.vscode-resource.vscode-cdn.net/Users/jasonqin/Documents/GitHub/point-e/point_e/examples/~/.pyenv/versions/mambaforge-22.9.0-3/lib/python3.10/site-packages/point_e/diffusion/sampler.py:163), in PointCloudSampler.sample_batch_progressive(self, batch_size, model_kwargs)
155 internal_batch_size *= 2
156 samples_it = diffusion.p_sample_loop_progressive(
157 model,
158 shape=(internal_batch_size, *sample_shape[1:]),
(...)
161 clip_denoised=self.clip_denoised,
162 )
--> 163 for x in samples_it:
...
-> 1016 res = th.from_numpy(arr).to(device=timesteps.device)[timesteps].float()
1017 while len(res.shape) < len(broadcast_shape):
1018 res = res[..., None]
TypeError: Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead.Source: openai/point-e