No module named 'points.datasets' for pytorch geometric

Hey guys, i tried to implement Pytorch geometric for the benchmark data of point. However, i receive the
No module named ‘points.datasets’ . i tried install but it shows there is not match, help pls

import argparse

import torch

import torch.nn.functional as F

from torch.nn import Linear as Lin

from torch_geometric.nn import XConv, fps, global_mean_pool

from points.datasets import get_dataset

from points.train_eval import run

parser = argparse.ArgumentParser()

parser.add_argument(’–epochs’, type=int, default=200)

parser.add_argument(’–batch_size’, type=int, default=32)

parser.add_argument(’–lr’, type=float, default=0.001)

parser.add_argument(’–lr_decay_factor’, type=float, default=0.5)

parser.add_argument(’–lr_decay_step_size’, type=int, default=50)

parser.add_argument(’–weight_decay’, type=float, default=0)

args = parser.parse_args()

class Net(torch.nn.Module):

def __init__(self, num_classes):

    super(Net, self).__init__()

    self.conv1 = XConv(0, 48, dim=3, kernel_size=8, hidden_channels=32)

    self.conv2 = XConv(

        48, 96, dim=3, kernel_size=12, hidden_channels=64, dilation=2)

    self.conv3 = XConv(

        96, 192, dim=3, kernel_size=16, hidden_channels=128, dilation=2)

    self.conv4 = XConv(

        192, 384, dim=3, kernel_size=16, hidden_channels=256, dilation=2)

    self.lin1 = Lin(384, 256)

    self.lin2 = Lin(256, 128)

    self.lin3 = Lin(128, num_classes)

def forward(self, pos, batch):

    x = F.relu(self.conv1(None, pos, batch))

    idx = fps(pos, batch, ratio=0.375)

    x, pos, batch = x[idx], pos[idx], batch[idx]

    x = F.relu(self.conv2(x, pos, batch))

    idx = fps(pos, batch, ratio=0.334)

    x, pos, batch = x[idx], pos[idx], batch[idx]

    x = F.relu(self.conv3(x, pos, batch))

    x = F.relu(self.conv4(x, pos, batch))

    x = global_mean_pool(x, batch)

    x = F.relu(self.lin1(x))

    x = F.relu(self.lin2(x))

    x = F.dropout(x, p=0.5, training=self.training)

    x = self.lin3(x)

    return F.log_softmax(x, dim=-1)

train_dataset, test_dataset = get_dataset(num_points=1024)

model = Net(train_dataset.num_classes)

run(train_dataset, test_dataset, model, args.epochs, args.batch_size, args.lr,

args.lr_decay_factor, args.lr_decay_step_size, args.weight_decay)

Is this code written by you or have you picked it up from some repo on github?

i picked it up from Github in https://github.com/rusty1s/pytorch_geometric/blob/master/benchmark/points/point_cnn.py

Can you share your directory structure here?

hey, i am new to programming. i am using the google colab.
I just run :
! pip install torch-scatter==latest+cu101

! pip install torch-sparse==latest+cu101

! pip install torch-cluster==latest+cu101

! pip install torch-spline-conv==latest+cu101

! pip install torch-geometric

i do not know how to show u the directory either

oh okay you are using colab.
Just type !ls in a kernel and share the output here.

Regards!

it shows sample_data

yeah, so the problem is you are not in the directory where all other files are!
You have to go into that folder where all the files are stored!

Wait a minute! did you just copy paste the code in colab or did you clone the github repo?

i copy paste, should i use !git clone
!git clone [github.com/rusty1s/pytorch_geometric.git]].
but i respond that the repository ‘[pytorch_geometric.git]’ does not exist

yeah you need to clone the repo and then launch the code. If you are using colab then you need to upload the entire repo on your drive and then you can access this code file from there

will Github dektop better to solve my problem?
I tried to implement GCN.py on IMBD-Binary
in https://github.com/rusty1s/pytorch_geometric/tree/master/benchmark/kernel.

i load data use datasets.py, GCN.py , train_eval.py. However, i could not get result that normally combined with epoch loops and accuracy. where did i do wrong?

Sorry for so many question in one time.

hey, i think i solve the part of my problem by
!pip install -q xlrd

!git clone https://github.com/rusty1s/pytorch_geometric.git

i think the problem is that i do not have module named ‘points’ . I had repository installed in google drive, the problem still exist

That is the problem. you dont have the file named datasets in your working directory. you have to make sure you include all the files in your working directory before running this code.