Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main.py: error: unrecognized arguments: --agg concat #12

Open
XueniLuo opened this issue May 26, 2022 · 2 comments
Open

main.py: error: unrecognized arguments: --agg concat #12

XueniLuo opened this issue May 26, 2022 · 2 comments

Comments

@XueniLuo
Copy link

Hi, I run the recommended code
python main.py --dataset ali --gnn ngcf --dim 64 --lr 0.0001 --batch_size 1024 --gpu_id 0 --context_hops 3 --agg concat --ns mixgcf --K 1 --n_negs 64

And received the issue:
main.py: error: unrecognized arguments: --agg concat;

I checked the file /utils/parser.py, and found the --agg parameter is not declared in that file.

Is there anything I missed?

Thanks for your time and have a nice day.

@mushding
Copy link

According to modules/LightGCN.py line 157-166

    def pooling(self, embeddings):
        # [-1, n_hops, channel]
        if self.pool == 'mean':
            return embeddings.mean(dim=1)
        elif self.pool == 'sum':
            return embeddings.sum(dim=1)
        elif self.pool == 'concat':
            return embeddings.view(embeddings.shape[0], -1)
        else:  # final
            return embeddings[:, -1, :]

And utils/parser.py line 33

parser.add_argument("--pool", type=str, default='concat', help="[concat, mean, sum, final]")

the "--agg" argument should be "--pool"

python main.py --dataset ali --gnn ngcf --dim 64 --lr 0.0001 --batch_size 1024 --gpu_id 0 --context_hops 3 --pool concat --ns mixgcf --K 1 --n_negs 64

fix that typo, issue should be solved.

@XueniLuo
Copy link
Author

XueniLuo commented Jul 6, 2022

According to modules/LightGCN.py line 157-166

    def pooling(self, embeddings):
        # [-1, n_hops, channel]
        if self.pool == 'mean':
            return embeddings.mean(dim=1)
        elif self.pool == 'sum':
            return embeddings.sum(dim=1)
        elif self.pool == 'concat':
            return embeddings.view(embeddings.shape[0], -1)
        else:  # final
            return embeddings[:, -1, :]

And utils/parser.py line 33

parser.add_argument("--pool", type=str, default='concat', help="[concat, mean, sum, final]")

the "--agg" argument should be "--pool"

python main.py --dataset ali --gnn ngcf --dim 64 --lr 0.0001 --batch_size 1024 --gpu_id 0 --context_hops 3 --pool concat --ns mixgcf --K 1 --n_negs 64

fix that typo, issue should be solved.

Thanks a lot, that completely solves my problem.
Have a nice day~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants