Skip to content

Quick Start problem. RuntimeError: Error building extension 'torch_ext' #249

@SatorioK

Description

@SatorioK

Hello. I encountered a problem when running Quick Start molecule classifier code. My related versions are torch==2.2.2+cu118, torch-cluster==1.6.3+pt22cu118, torch-scatter==2.1.2+pt22cu118, torchdrug==0.2.1. CUDA is installed with version 11.8.
The error is:
`Traceback (most recent call last):
File "D:\PyCodes\tdrug\torchdrug_test.py", line 16, in
solver.train(num_epoch=100)
File "D:\PyCodes\tdrug\venv\lib\site-packages\torchdrug\core\engine.py", line 161, in train
loss, metric = model(batch)
File "D:\PyCodes\tdrug\venv\lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "D:\PyCodes\tdrug\venv\lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "D:\PyCodes\tdrug\venv\lib\site-packages\torchdrug\tasks\property_prediction.py", line 102, in forward
pred = self.predict(batch, all_loss, metric)
File "D:\PyCodes\tdrug\venv\lib\site-packages\torchdrug\tasks\property_prediction.py", line 140, in predict
output = self.model(graph, graph.node_feature.float(), all_loss=all_loss, metric=metric)
File "D:\PyCodes\tdrug\venv\lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "D:\PyCodes\tdrug\venv\lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "D:\PyCodes\tdrug\venv\lib\site-packages\torchdrug\models\gin.py", line 76, in forward
hidden = layer(graph, layer_input)
File "D:\PyCodes\tdrug\venv\lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "D:\PyCodes\tdrug\venv\lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "D:\PyCodes\tdrug\venv\lib\site-packages\torchdrug\layers\conv.py", line 91, in forward
update = self.message_and_aggregate(graph, input)
File "D:\PyCodes\tdrug\venv\lib\site-packages\torchdrug\layers\conv.py", line 337, in message_and_aggregate
adjacency = utils.sparse_coo_tensor(graph.edge_list.t()[:2], graph.edge_weight,
File "D:\PyCodes\tdrug\venv\lib\site-packages\torchdrug\utils\torch.py", line 185, in sparse_coo_tensor
return torch_ext.sparse_coo_tensor_unsafe(indices, values, size)
File "D:\PyCodes\tdrug\venv\lib\site-packages\torchdrug\utils\torch.py", line 26, in getattr
return getattr(self.module, key)
File "D:\PyCodes\tdrug\venv\lib\site-packages\torchdrug\utils\decorator.py", line 102, in get
result = self.func(obj)
File "D:\PyCodes\tdrug\venv\lib\site-packages\torchdrug\utils\torch.py", line 30, in module
return cpp_extension.load(self.name, self.sources, self.extra_cflags, self.extra_cuda_cflags,
File "D:\PyCodes\tdrug\venv\lib\site-packages\torch\utils\cpp_extension.py", line 1306, in load
return _jit_compile(
File "D:\PyCodes\tdrug\venv\lib\site-packages\torch\utils\cpp_extension.py", line 1710, in _jit_compile
_write_ninja_file_and_build_library(
File "D:\PyCodes\tdrug\venv\lib\site-packages\torch\utils\cpp_extension.py", line 1823, in _write_ninja_file_and_build_library
_run_ninja_build(
File "D:\PyCodes\tdrug\venv\lib\site-packages\torch\utils\cpp_extension.py", line 2112, in _run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error building extension 'torch_ext': [1/1] "D:\Tools\MicrosoftVS\Crap\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64/link.exe" torch_ext.o /nologo /DLL c10.lib torch_cpu.lib torch.lib /LIBPATH:D:\PyCodes\tdrug\venv\lib\site-packages\torch\lib torch_python.lib /LIBPATH:D:\PyCodes\tdrug\venv\Scripts\libs /out:torch_ext.pyd
FAILED: torch_ext.pyd
"D:\Tools\MicrosoftVS\Crap\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64/link.exe" torch_ext.o /nologo /DLL c10.lib torch_cpu.lib torch.lib /LIBPATH:D:\PyCodes\tdrug\venv\lib\site-packages\torch\lib torch_python.lib /LIBPATH:D:\PyCodes\tdrug\venv\Scripts\libs /out:torch_ext.pyd

ninja: build stopped: subcommand failed.`

I don't know what the cause of this problem is. Anyone's assistance is appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions