GithubHelp home page GithubHelp logo

cgipool's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

cgipool's Issues

There is a bug in this code

Traceback (most recent call last):
File "/home/sc5/lizhipeng/GNN/pool/constrastive learning/CGIPool-main/train.py", line 127, in
main()
File "/home/sc5/lizhipeng/GNN/pool/constrastive learning/CGIPool-main/train.py", line 116, in main
train(args, model, train_loader, val_loader)
File "/home/sc5/lizhipeng/GNN/pool/constrastive learning/CGIPool-main/train.py", line 40, in train
output = model(data)
File "/home/sc5/anaconda3/envs/cl/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/sc5/lizhipeng/GNN/pool/constrastive learning/CGIPool-main/models/SAGNet.py", line 42, in forward
x, edge_index, _, batch, _, loss = self.pool1(x, edge_index, None, batch)
File "/home/sc5/anaconda3/envs/cl/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/sc5/lizhipeng/GNN/pool/constrastive learning/CGIPool-main/poolings/CGIPool.py", line 70, in forward
real_loss = self.loss_fn(self.discriminator(positive_pair), real)
File "/home/sc5/anaconda3/envs/cl/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/sc5/anaconda3/envs/cl/lib/python3.6/site-packages/torch/nn/modules/loss.py", line 530, in forward
return F.binary_cross_entropy(input, target, weight=self.weight, reduction=self.reduction)
File "/home/sc5/anaconda3/envs/cl/lib/python3.6/site-packages/torch/nn/functional.py", line 2519, in binary_cross_entropy
"Please ensure they have the same size.".format(target.size(), input.size()))
ValueError: Using a target size (torch.Size([128])) that is different to the input size (torch.Size([128, 1])) is deprecated. Please ensure they have the same size.

i have solved it. The correct code which should be:
real = torch.ones(positive_pair.shape[0],1).cuda()
fake = torch.zeros(negative_pair.shape[0],1).cuda()

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.