Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not run 'aten::_pin_memory' with arguments from the 'CUDA' backend #471

Open
laami121 opened this issue Aug 1, 2024 · 0 comments
Open

Comments

@laami121
Copy link

laami121 commented Aug 1, 2024

question:How can I ensure that the versions of torch and torchvision are consistent with the CUDA version? thx!!!

D:\App\DragGAN\DragGAN>scripts\gui.bat
Loading "D:\App\DragGAN\DragGAN\checkpoints\stylegan2_lions_512_pytorch.pkl"... C:\Users\CD\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\storage.py:414: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
return torch.load(io.BytesIO(b))
Done.
()
{'z_dim': 512, 'c_dim': 0, 'w_dim': 512, 'img_resolution': 512, 'img_channels': 3, 'mapping_kwargs': {'num_layers': 8, 'embed_features': None, 'layer_features': None, 'activation': 'lrelu', 'lr_multiplier': 0.01, 'w_avg_beta': 0.995}, 'synthesis_kwargs': {'channel_base': 32768, 'channel_max': 512, 'num_fp16_res': 0, 'conv_clamp': None, 'architecture': 'skip', 'resample_filter': [1, 3, 3, 1], 'use_noise': True, 'activation': 'lrelu'}}
Traceback (most recent call last):
File "D:\App\DragGAN\DragGAN\visualizer_drag.py", line 403, in
main()
File "C:\Users\CD\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\CD\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "C:\Users\CD\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\CD\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\App\DragGAN\DragGAN\visualizer_drag.py", line 397, in main
viz.draw_frame()
File "D:\App\DragGAN\DragGAN\visualizer_drag.py", line 168, in draw_frame
self._async_renderer.set_args(**self.args)
File "D:\App\DragGAN\DragGAN\visualizer_drag.py", line 295, in set_args
self._set_args_sync(**args)
File "D:\App\DragGAN\DragGAN\visualizer_drag.py", line 313, in _set_args_sync
self._cur_result = self._renderer_obj.render(**args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\App\DragGAN\DragGAN\viz\renderer.py", line 119, in render
res.image = self.to_cpu(res.image).detach().numpy()
^^^^^^^^^^^^^^^^^^^^^^
File "D:\App\DragGAN\DragGAN\viz\renderer.py", line 191, in to_cpu
return self.get_pinned_buf(buf).copy(buf).clone()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\App\DragGAN\DragGAN\viz\renderer.py", line 183, in _get_pinned_buf
buf = torch.empty(ref.shape, dtype=ref.dtype).pin_memory()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
NotImplementedError: Could not run 'aten::_pin_memory' with arguments from the 'CUDA' backend. This could be because the operator doesn't exist for this backend, or was omitted during the selective/custom build process (if using custom build). If you are a Facebook employee using PyTorch on mobile, please visit https://fburl.com/ptmfixes for possible resolutions. 'aten::_pin_memory' is only available for these backends: [Meta, NestedTensorCPU, BackendSelect, Python, FuncTorchDynamicLayerBackMode, Functionalize, Named, Conjugate, Negative, ZeroTensor, ADInplaceOrView, AutogradOther, AutogradCPU, AutogradCUDA, AutogradHIP, AutogradXLA, AutogradMPS, AutogradIPU, AutogradXPU, AutogradHPU, AutogradVE, AutogradLazy, AutogradMTIA, AutogradPrivateUse1, AutogradPrivateUse2, AutogradPrivateUse3, AutogradMeta, AutogradNestedTensor, Tracer, AutocastCPU, AutocastXPU, AutocastCUDA, FuncTorchBatched, BatchedNestedTensor, FuncTorchVmapMode, Batched, VmapMode, FuncTorchGradWrapper, PythonTLSSnapshot, FuncTorchDynamicLayerFrontMode, PreDispatch, PythonDispatcher].

Meta: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\core\MetaFallbackKernel.cpp:23 [backend fallback]
NestedTensorCPU: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\build\aten\src\ATen\RegisterNestedTensorCPU.cpp:783 [kernel]
BackendSelect: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\build\aten\src\ATen\RegisterBackendSelect.cpp:815 [kernel]
Python: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\core\PythonFallbackKernel.cpp:153 [backend fallback]
FuncTorchDynamicLayerBackMode: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\functorch\DynamicLayer.cpp:497 [backend fallback]
Functionalize: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\FunctionalizeFallbackKernel.cpp:349 [backend fallback]
Named: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\core\NamedRegistrations.cpp:7 [backend fallback]
Conjugate: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\ConjugateFallback.cpp:17 [backend fallback]
Negative: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\NegateFallback.cpp:18 [backend fallback]
ZeroTensor: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\ZeroTensorFallback.cpp:86 [backend fallback]
ADInplaceOrView: fallthrough registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\core\VariableFallbackKernel.cpp:86 [backend fallback]
AutogradOther: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\autograd\generated\VariableType_0.cpp:18032 [autograd kernel]
AutogradCPU: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\autograd\generated\VariableType_0.cpp:18032 [autograd kernel]
AutogradCUDA: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\autograd\generated\VariableType_0.cpp:18032 [autograd kernel]
AutogradHIP: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\autograd\generated\VariableType_0.cpp:18032 [autograd kernel]
AutogradXLA: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\autograd\generated\VariableType_0.cpp:18032 [autograd kernel]
AutogradMPS: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\autograd\generated\VariableType_0.cpp:18032 [autograd kernel]
AutogradIPU: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\autograd\generated\VariableType_0.cpp:18032 [autograd kernel]
AutogradXPU: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\autograd\generated\VariableType_0.cpp:18032 [autograd kernel]
AutogradHPU: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\autograd\generated\VariableType_0.cpp:18032 [autograd kernel]
AutogradVE: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\autograd\generated\VariableType_0.cpp:18032 [autograd kernel]
AutogradLazy: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\autograd\generated\VariableType_0.cpp:18032 [autograd kernel]
AutogradMTIA: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\autograd\generated\VariableType_0.cpp:18032 [autograd kernel]
AutogradPrivateUse1: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\autograd\generated\VariableType_0.cpp:18032 [autograd kernel]
AutogradPrivateUse2: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\autograd\generated\VariableType_0.cpp:18032 [autograd kernel]
AutogradPrivateUse3: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\autograd\generated\VariableType_0.cpp:18032 [autograd kernel]
AutogradMeta: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\autograd\generated\VariableType_0.cpp:18032 [autograd kernel]
AutogradNestedTensor: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\autograd\generated\VariableType_0.cpp:18032 [autograd kernel]
Tracer: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\autograd\generated\TraceType_0.cpp:17004 [kernel]
AutocastCPU: fallthrough registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\autocast_mode.cpp:209 [backend fallback]
AutocastXPU: fallthrough registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\autocast_mode.cpp:351 [backend fallback]
AutocastCUDA: fallthrough registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\autocast_mode.cpp:165 [backend fallback]
FuncTorchBatched: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\functorch\LegacyBatchingRegistrations.cpp:731 [backend fallback]
BatchedNestedTensor: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\functorch\LegacyBatchingRegistrations.cpp:758 [backend fallback]
FuncTorchVmapMode: fallthrough registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\functorch\VmapModeRegistrations.cpp:27 [backend fallback]
Batched: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\LegacyBatchingRegistrations.cpp:1075 [backend fallback]
VmapMode: fallthrough registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\VmapModeRegistrations.cpp:33 [backend fallback]
FuncTorchGradWrapper: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\functorch\TensorWrapper.cpp:207 [backend fallback]
PythonTLSSnapshot: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\core\PythonFallbackKernel.cpp:161 [backend fallback]
FuncTorchDynamicLayerFrontMode: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\functorch\DynamicLayer.cpp:493 [backend fallback]
PreDispatch: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\core\PythonFallbackKernel.cpp:165 [backend fallback]
PythonDispatcher: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\core\PythonFallbackKernel.cpp:157 [backend fallback]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant