pythonpytorchoserrorpytorch-geometric

"[WinError 127] The specified procedure could not be found" for torch_geometric


I am trying to run a dataset class's get() method (the class inherits from pyg.data.Dataset). This is what I called

dataset_sample = OneStepDataset(OUTPUT_DIR, "valid", return_pos=True)
graph, position = dataset_sample[0]

The compiler traces to these lines in C:\...\AppData\Local\Programs\Python\Python39\lib\site-packages\torch_geometric\data\dataset.py:197

 if (isinstance(idx, (int, np.integer))
    194         or (isinstance(idx, Tensor) and idx.dim() == 0)
    195         or (isinstance(idx, np.ndarray) and np.isscalar(idx))):
--> 197     data = self.get(self.indices()[idx])
    198     data = data if self.transform is None else self.transform(data)
    199     return data

and then to this one which I don't know where it came from

...
--> 374     self._handle = _dlopen(self._name, mode)
    375 else:
    376     self._handle = handle

and the error is

OSError: [WinError 127] The specified procedure could not be found

I would like to know some possible solutions for this error in this context.


Solution

  • Apparently, the problem is to do with having multiple versions of torch-geometric or one of its dependencies. The problem is solved after uninstalling torch-geometric and all its dependencies by pip uninstall torch-geometric torch-scatter torch-sparse torch-cluster torch-spline-conv and then reinstalling torch-geometric by referencing https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html