yvquanli / GLAM

Code for "An adaptive graph learning method for automated molecular interactions and properties predictions".
https://www.nature.com/articles/s42256-022-00501-8
MIT License
39 stars 8 forks source link

I encountered two problems during the run a demo phase. #1

Closed DeepAIDD closed 2 years ago

DeepAIDD commented 2 years ago

Hello, I'm very interested in your project, but I encountered two problems in the run a demo stage.

Test for dataset.py and run.py! Loading dataset... Traceback (most recent call last): File "./run.py", line 55, in args, dataset, Trainer = auto_dataset(args) File "/root/prog/wzp/GLAM/GLAM/src_1gp/dataset.py", line 38, in auto_dataset _dataset = Dataset(args.dataset_root, File "/root/prog/wzp/GLAM/GLAM/src_1gp/dataset.py", line 107, in init trn, val, test = self.split(type=split) File "/root/prog/wzp/GLAM/GLAM/src_1gp/dataset.py", line 177, in split trn, val, test = random_scaffold_split(dataset=shuffled, smiles_list=shuffled.data.smi, File "/root/prog/wzp/GLAM/GLAM/src_1gp/utils.py", line 160, in random_scaffold_split scaffold_sets = rng.perperturb(list(scaffolds.values())) AttributeError: 'numpy.random.mtrand.RandomState' object has no attribute 'perperturb' Demo running... GLAMHelper pr of demo start... Solver for demo running start @ Fri Jul 1 10:43:27 2022 1 gpus available Configuration 0 start: config_id is 532ed config is {'dataset': 'demo', 'dataset_root': './demo', 'seed': 1234, 'split_seed': 1234, 'hid_dim_alpha': 2, 'e_dim': 2048, 'mol_block': '_TripletMessageLight', 'message_steps': 2, 'mol_readout': 'GlobalLAPool', 'pre_do': '_None()', 'graph_do': '_None()', 'flat_do': 'Dropout(0.1)', 'end_do': 'Dropout(0.5)', 'pre_norm': '_LayerNorm', 'graph_norm': '_None', 'flat_norm': '_LayerNorm', 'end_norm': '_None', 'pre_act': 'RReLU', 'graph_act': 'CELU', 'flat_act': 'ReLU', 'graph_res': 1, 'loss': 'bcel', 'batch_size': 768, 'optim': 'Ranger', 'k': 3, 'epochs': 30, 'lr': 0.001, 'early_stop_patience': 50} Choosing the GPU device has largest free memory... Sorted by free memory size Using GPU 0: index:0 gpu_name:NVIDIA GeForce GTX 1050 Ti memory.free:4020 memory.total:4038 Choosing the GPU device has largest free memory... Sorted by free memory size Using GPU 0: index:0 gpu_name:NVIDIA GeForce GTX 1050 Ti memory.free:4020 memory.total:4038 python3 run.py --dataset demo --dataset_root ./demo --seed 12 --split_seed 1234 --hid_dim_alpha 2 --e_dim 2048 --mol_block _TripletMessageLight --message_steps 2 --mol_readout GlobalLAPool --pre_do _None() --graph_do _None() --flat_do Dropout(0.1) --end_do Dropout(0.5) --pre_norm _LayerNorm --graph_norm _None --flat_norm _LayerNorm --end_norm _None --pre_act RReLU --graph_act CELU --flat_act ReLU --graph_res 1 --loss bcel --batch_size 768 --optim Ranger --k 3 --epochs 30 --lr 0.001 --early_stop_patience 50 --note 532ed --gpu 0 Traceback (most recent call last): File "run.py", line 7, in import os; os.chdir(os.path.dirname(file)) FileNotFoundError: [Errno 2] No such file or directory: ''

yvquanli commented 2 years ago

I have update the run.py (add a '#' to line 7). It was prepared for vscode enviroments

yvquanli commented 2 years ago

If there is other lines like this 'import os; os.chdir(os.path.dirname(file))', just add a '#' is ok

DeepAIDD commented 2 years ago

I have update the run.py (add a '#' to line 7). It was prepared for vscode enviroments

Thank you, but I also encountered this problem: AttributeError: 'numpy.random.mtrand.RandomState' object has no attribute 'perperturb'
Is it because of the numpy version?

yvquanli commented 2 years ago

wait a minute

yvquanli commented 2 years ago

OK now.

yvquanli commented 2 years ago

perperturb -> permutation

yvquanli commented 2 years ago

Any problems let me know.

DeepAIDD commented 2 years ago

Any problems let me know.

Thanks, another question:Traceback (most recent call last): File "run.py", line 63, in trainer.pasp() AttributeError: 'TrainerMolBinaryClassificationNANBCE' object has no attribute 'pasp'

DeepAIDD commented 2 years ago

Any problems let me know.

Thanks, another question:Traceback (most recent call last): File "run.py", line 63, in trainer.pasp() AttributeError: 'TrainerMolBinaryClassificationNANBCE' object has no attribute 'pasp'

OK,trainer.pasp() >>>trainer.train_and_test() 感谢大佬!!!哈哈哈

yvquanli commented 2 years ago

对的,把trainer.pasp()注释掉就行了,这一句是为physprop_purturb数据集准备的