sysu18364004 / SGCN

7 stars 2 forks source link

作者您好 #2

Open suyilei20000703 opened 6 months ago

suyilei20000703 commented 6 months ago

作者您好,您能告诉我SGCN模型的运行环境吗?我复现该模型,输入python main.py --train_size 1.0报错为 File "D:\SGCN-main\SGCN\SGCN_MLTC\model.py", line 179, in forward torch.vstack() AttributeError: module 'torch' has no attribute 'vstack'这个如何解决?

sysu18364004 commented 6 months ago

我用的是python3.9+torch2.0.0,这个torch.vstack直接用torch.cat代替也行

suyilei20000703 commented 6 months ago

好的,谢谢您,我放到3090服务器上能运行了。现在有个SGCN_MLTC目录下运行模型报错为Traceback (most recent call last): File "main.py", line 150, in show_result=True) File "/root/autodl-tmp/SGCN-main/SGCN/SGCN_MLTC/train.py", line 72, in train_model torch.save(model,save_path) File "/root/miniconda3/envs/py/lib/python3.6/site-packages/torch/serialization.py", line 369, in save with _open_file_like(f, 'wb') as opened_file: File "/root/miniconda3/envs/py/lib/python3.6/site-packages/torch/serialization.py", line 230, in _open_file_like return _open_file(name_or_buffer, mode) File "/root/miniconda3/envs/py/lib/python3.6/site-packages/torch/serialization.py", line 211, in init super(_open_file, self).init(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: 'model/best_model.pth',我看您的代码中,train.py里创建了train_model方法,里面保存了save_path = 'model/best_model.pth'这个路径,但是运行python main.py --train_size 1.0没有生成该文件。

suyilei20000703 commented 6 months ago

已经解决了,谢谢作者,刚才路径输错了