Giter Club home page Giter Club logo

Comments (12)

Richarizardd avatar Richarizardd commented on May 24, 2024

Hi @shubhaminnani - At the time of this publication, one of the earliest versions of torch-geometric was used. Your torch-scatter, torch-sparse, and other packages are of the latest update and may not have good backwards compatibility with previous versions of PyG.

For this study: the dependencies for PyG==1.3.0 may have been torch-scatter==1.3.1, torch-sparse==0.4.0, torch-cluster==1.4.4. Though this codebase depends on legacy code, I would recommend updating everything to the most recent versions of PyG, which may require some minor modifications to the forward pass of some of the model architectures. In addition, note that there may be some minor instabilities with previous versions of PyG, e.g. - pytorch/pytorch#50469.

from pathomicfusion.

shubhaminnani avatar shubhaminnani commented on May 24, 2024

Thanks for update. Will check and revert with you!

from pathomicfusion.

shubhaminnani avatar shubhaminnani commented on May 24, 2024

Hi @Richarizardd ,
I am pretty much new to Pathology, if you can help to update the code, it will be really helpful.
Thanks!

from pathomicfusion.

shubhaminnani avatar shubhaminnani commented on May 24, 2024

Hi @Richarizardd

I was not able to understand whats needs to be changed here.

class GraphNet(torch.nn.Module):
    def __init__(self, features=1036, nhid=128, grph_dim=32, nonlinearity=torch.tanh, 
        dropout_rate=0.25, GNN='GCN', use_edges=0, pooling_ratio=0.20, act=None, label_dim=1, init_max=True):
        super(GraphNet, self).__init__()

        self.dropout_rate = dropout_rate
        self.use_edges = use_edges
        self.act = act

        self.conv1 = SAGEConv(features, nhid)
        self.pool1 = SAGPooling(nhid, ratio=pooling_ratio, gnn=GNN)#, nonlinearity=nonlinearity)
        self.conv2 = SAGEConv(nhid, nhid)
        self.pool2 = SAGPooling(nhid, ratio=pooling_ratio, gnn=GNN)#, nonlinearity=nonlinearity)
        self.conv3 = SAGEConv(nhid, nhid)
        self.pool3 = SAGPooling(nhid, ratio=pooling_ratio, gnn=GNN)#, nonlinearity=nonlinearity)

        self.lin1 = torch.nn.Linear(nhid*2, nhid)
        self.lin2 = torch.nn.Linear(nhid, grph_dim)
        self.lin3 = torch.nn.Linear(grph_dim, label_dim)

        self.output_range = Parameter(torch.FloatTensor([6]), requires_grad=False)
        self.output_shift = Parameter(torch.FloatTensor([-3]), requires_grad=False)

        if init_max: 
            init_max_weights(self)
            print("Initialzing with Max")

    def forward(self, **kwargs):
        data = kwargs['x_grph']
        data = NormalizeFeaturesV2()(data)
        data = NormalizeEdgesV2()(data)
        x, edge_index, edge_attr, batch = data.x, data.edge_index, data.edge_attr, data.batch
        
        #x, edge_index, edge_attr, batch = data.x.type(torch.cuda.FloatTensor), data.edge_index.type(torch.cuda.LongTensor), data.edge_attr.type(torch.cuda.FloatTensor), data.batch
        x = F.relu(self.conv1(x, edge_index)) ##need to check this

From above code, it seem we are passing 5 values only, but torch_scatter throws the Error.

Can you please suggest?

from pathomicfusion.

zqy396 avatar zqy396 commented on May 24, 2024

I also encountered this problem. Have you solved it?

from pathomicfusion.

zqy396 avatar zqy396 commented on May 24, 2024

@shubhaminnani

from pathomicfusion.

shubhaminnani avatar shubhaminnani commented on May 24, 2024

This is version dependencies of PyG. I was not able to look into this further.
Thanks!

from pathomicfusion.

zqy396 avatar zqy396 commented on May 24, 2024

i have solved. you should change the ''scatter.py'' file.

from pathomicfusion.

shubhaminnani avatar shubhaminnani commented on May 24, 2024

Hi @zqy396

Can you please post the changes from the scatter.py? It will be really helpful.

Thanks!

from pathomicfusion.

shubhaminnani avatar shubhaminnani commented on May 24, 2024

image
Is this the correct thing to be updated?

from pathomicfusion.

foxhxer avatar foxhxer commented on May 24, 2024

@zqy396
May I ask how you made modifications in the scatter.py file?

from pathomicfusion.

XGGNet avatar XGGNet commented on May 24, 2024

https://blog.csdn.net/m0_37052320/article/details/118368656

@zqy396 May I ask how you made modifications in the scatter.py file?

from pathomicfusion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.