LFhase / GIA-HAO

[ICLR 2022] Understanding and Improving Graph Injection Attack by Promoting Unnoticeability
https://openreview.net/forum?id=wkMG8cdvh7-
MIT License
37 stars 3 forks source link

可以标注一下库的版本吗 #1

Closed tianzhaohaha closed 1 year ago

LFhase commented 2 years ago

Sorry for the late reply. The key libraries are:

grb==0.1.0
torch==1.9.0
torch-geometric==1.7.2
tianzhaohaha commented 2 years ago

感谢

---原始邮件--- 发件人: "Andrew @.> 发送时间: 2022年6月7日(周二) 下午3:07 收件人: @.>; 抄送: "Qingyuan @.**@.>; 主题: Re: [LFhase/GIA-HAO] 可以标注一下库的版本吗 (Issue #1)

Sorry for the late reply. The key libraries are: grb==0.1.0 torch==1.9.0 torch-geometric==1.7.2
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

LFhase commented 2 years ago

I am closing this issue now. Feel free to reopen it if you have any further questions.

ziqi-zhang commented 1 year ago

我遇到的问题是scipy不能使用最新的1.9.3版本,会遇到如下问题

Traceback (most recent call last):
  File "gnn_misg.py", line 686, in <module>
    main()
  File "gnn_misg.py", line 609, in main
    x_attack, adj_attack, target_idx = eval_robustness(model, x_test, adj_test, target_idx, data.y, device, args, run)
  File "gnn_misg.py", line 229, in eval_robustness
    adj_attack, features_attack = attacker.attack(model=model,
  File "GIA-HAO/attacks/gia.py", line 68, in attack
    adj_attack = random_injection(adj,self.n_inject_max, self.n_edge_max, target_idx, self.device)
  File "GIA-HAO/attacks/injection.py", line 126, in random_injection
    adj_attack.row = np.hstack([adj_attack.row, new_edges_x])
  File "anaconda3/envs/graph/lib/python3.8/site-packages/scipy/sparse/_base.py", line 761, in __getattr__
    raise AttributeError(attr + " not found")
AttributeError: row not found

使用1.7.0版本可以解决这个问题。

LFhase commented 1 year ago

Could you try the following libraries?

torch-scatter==2.0.8
torch-sparse==0.6.11
scipy==1.6.2
ziqi-zhang commented 1 year ago

My environment is

torch                     1.9.0+cu111              pypi_0    pypi
torch-geometric           1.7.2                    pypi_0    pypi
torch-scatter             2.0.9                    pypi_0    pypi
torch-sparse              0.6.10                   pypi_0    pypi
torchaudio                0.9.0                    pypi_0    pypi
torchvision               0.10.0+cu111             pypi_0    pypi
scipy                     1.7.0                    pypi_0    pypi

I also tried your recommendation and they works fine!

$ conda list torch                  
# packages in environment at /home/anaconda3/envs/HAO2:
#
# Name                    Version                   Build  Channel
torch                     1.9.0+cu111              pypi_0    pypi
torch-geometric           1.7.2                    pypi_0    pypi
torch-scatter             2.0.8                    pypi_0    pypi
torch-sparse              0.6.11                   pypi_0    pypi
torchaudio                0.9.0                    pypi_0    pypi
torchvision               0.10.0+cu111             pypi_0    pypi
(HAO2) 
$ conda list scipy                  
# packages in environment at /home/anaconda3/envs/HAO2:
#
# Name                    Version                   Build  Channel
scipy                     1.6.2                    pypi_0    pypi
LFhase commented 1 year ago

Thank Ziqi very much! I'll link this issue to the corresponding sections in the readme so that more people would benefit from your comments 😄

BTW, I'll close this issue as the problem is resolved. Feel free to reopen this issue if there are any further problems 😄