ImportError Traceback most recent call last Cell In1 line 6 4 from torch_geometricdata import DataLoader 5 from torch_geometricnn import GCNConv ---- 6 from t
The error message suggests that the InMemoryDataset class cannot be imported from the torch_geometric.datasets module. This could be due to a few possible reasons:
-
Outdated or incompatible version: Make sure you have the latest version of
torch_geometricinstalled. You can try updating it usingpip install --upgrade torch-geometric. -
Incorrect installation: If you recently installed
torch_geometric, try reinstalling it by following the installation instructions provided in the official documentation. -
Incorrect import statement: Double-check that you are importing the correct class from the correct module. The
InMemoryDatasetclass should be imported fromtorch_geometric.datainstead oftorch_geometric.datasets.
Make sure to address these potential issues and try again. If the problem persists, provide more information about your environment and the steps you followed to install torch_geometric so that we can assist you further.
原文地址: https://www.cveoy.top/t/topic/i6c0 著作权归作者所有。请勿转载和采集!