pengxingang / Pocket2Mol

Pocket2Mol: Efficient Molecular Sampling Based on 3D Protein Pockets
MIT License
242 stars 65 forks source link

sample issue #6

Closed amarye closed 1 year ago

amarye commented 1 year ago

I got error, when I ran samply.py as following:

Pocket2Mol-main$ python sample.py --data_id 1 --outdir ./outputs [2022-09-19 16:56:38,371::sample::INFO] Namespace(config='./configs/sample.yml', data_id='1', device='cuda', outdir='./outputs') [2022-09-19 16:56:38,371::sample::INFO] {'data': {'data_name': 'test', 'dataset': {'name': 'pl', 'path': './data/crossdocked_pocket10', 'split': './data/split_by_name.pt'}}, 'model': {'checkpoint': './home/amar/Pocket2Mol-main/ckpt/pretrained_Pocket2Mol.pt'}, 'sample': {'seed': 2020, 'mask_init': True, 'num_samples': 100, 'beam_size': 500, 'max_steps': 50, 'threshold': {'focal_threshold': 0.5, 'pos_threshold': 0.25, 'element_threshold': 0.3, 'hasatom_threshold': 0.6, 'bond_threshold': 0.4}}} [2022-09-19 16:56:38,371::sample::INFO] Loading data... Traceback (most recent call last): File "sample.py", line 211, in base_data = testset[data_id] File "/home/amar/anaconda3/envs/Pocket2Mol/lib/python3.8/site-packages/torch/utils/data/dataset.py", line 363, in getitem return self.dataset[self.indices[idx]] IndexError: list index out of range

Could you please help me to solve this problem?

pengxingang commented 1 year ago

I guess there are some problems with the crossdocked_pocket10_name2id.pt file. This file is automatically generated when you first run the model. You can try to delete crossdocked_pocket10_name2id.pt and crossdocked_pocket10_processed.lmdb. Then this file will be generated again.