CAODH / EquiScore

MIT License
47 stars 3 forks source link

IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed #2

Open Zehui7Zhou opened 1 year ago

Zehui7Zhou commented 1 year ago

(EquiScore) usr@Joptop:~/Programs/EquiScore-main$ python Screening.py --ngpu 1 --test --test_path ./data/sample_data/ --test_name tmp_pockets --pred_save_path ./data/test_results/ 2023-06-29 16:13:10 Traceback (most recent call last): File "Screening.py", line 82, in cmd = get_available_gpu(num_gpu=args.ngpu, min_memory=28000, sample=3, nitro_restriction=False, verbose=True) File "/home/zehuizhou/Programs/EquiScore-main/dist_utils.py", line 59, in get_available_gpu available = avg[np.where(avg[:,2] > min_memory)]
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

CAODH commented 1 year ago

What is the capacity of your gpu? i think you can try use a min_memory args suit for your device.

Zehui7Zhou commented 1 year ago

I am using RTX3060 mobile, capacity is 6G. I reinstalled my nvidia driver then the error changed to the new one. (EquiScore) usr@Joptop:~/Programs/EquiScore-main$ python Screening.py --ngpu 1 --test --test_path ./data/sample_data/ --test_name tmp_pockets --pred_save_path ./data/test_results/ 2023-06-29 19:49:40 avaliable gpus are less than required

Zehui7Zhou commented 1 year ago

What is the capacity of your gpu? i think you can try use a min_memory args suit for your device.

Thanks! I changed the "min_memory" from "28000" to "2800" in the Screening.py line 82 "cmd = get_available_gpu(num_gpu=args.ngpu, min_memory=28000, sample=3, nitro_restriction=False, verbose=True)", it works. And I also want to ask how to interpret the results, does a smaller value correspond to a better compound? (['./data/sample_data/tmp_pockets/sample_compounds_Compound_1', './data/sample_data/tmp_pockets/sample_compounds_Compound_16', './data/sample_data/tmp_pockets/sample_compounds_Compound_8', './data/sample_data/tmp_pockets/sample_compounds_Compound_21', './data/sample_data/tmp_pockets/sample_compounds_Compound_13', './data/sample_data/tmp_pockets/sample_compounds_Compound_11', './data/sample_data/tmp_pockets/sample_compounds_Compound_17', './data/sample_data/tmp_pockets/sample_compounds_Compound_15', './data/sample_data/tmp_pockets/sample_compounds_Compound_19', './data/sample_data/tmp_pockets/sample_compounds_Compound_38', './data/sample_data/tmp_pockets/sample_compounds_Compound_12', './data/sample_data/tmp_pockets/sample_compounds_Compound_24', './data/sample_data/tmp_pockets/sample_compounds_Compound_39', './data/sample_data/tmp_pockets/sample_compounds_Compound_32', './data/sample_data/tmp_pockets/sample_compounds_Compound_9', './data/sample_data/tmp_pockets/sample_compounds_Compound_26', './data/sample_data/tmp_pockets/sample_compounds_Compound_30', './data/sample_data/tmp_pockets/sample_compounds_Compound_31', './data/sample_data/tmp_pockets/sample_compounds_Compound_29', './data/sample_data/tmp_pockets/sample_compounds_Compound_27', './data/sample_data/tmp_pockets/sample_compounds_Compound_35', './data/sample_data/tmp_pockets/sample_compounds_Compound_23', './data/sample_data/tmp_pockets/sample_compounds_Compound_36', './data/sample_data/tmp_pockets/sample_compounds_Compound_14', './data/sample_data/tmp_pockets/sample_compounds_Compound_22', './data/sample_data/tmp_pockets/sample_compounds_Compound_4', './data/sample_data/tmp_pockets/sample_compounds_Compound_25', './data/sample_data/tmp_pockets/sample_compounds_Compound_28', './data/sample_data/tmp_pockets/sample_compounds_Compound_34', './data/sample_data/tmp_pockets/sample_compounds_Compound_5', './data/sample_data/tmp_pockets/sample_compounds_Compound_33', './data/sample_data/tmp_pockets/sample_compounds_Compound_6', './data/sample_data/tmp_pockets/sample_compounds_Compound_10', './data/sample_data/tmp_pockets/sample_compounds_Compound_7', './data/sample_data/tmp_pockets/sample_compounds_Compound_18', './data/sample_data/tmp_pockets/sample_compounds_Compound_37', './data/sample_data/tmp_pockets/sample_compounds_Compound_20', './data/sample_data/tmp_pockets/sample_compounds_Compound_2', './data/sample_data/tmp_pockets/sample_compounds_Compound_3', './data/sample_data/tmp_pockets/sample_compounds_Compound_0'], array([5.9237815e-03, 7.2738612e-01, 8.3176845e-01, 9.9041688e-01, 6.9196236e-01, 3.4791189e-01, 3.9930293e-01, 8.8924563e-01, 8.2876543e-03, 3.6662969e-01, 3.1219095e-01, 7.0540089e-04, 9.5426762e-01, 4.1270119e-01, 9.9498761e-01, 9.2069167e-01, 2.4307099e-01, 2.1481217e-01, 9.9034542e-01, 9.5566797e-01, 8.5230125e-03, 9.3324035e-01, 9.9489176e-01, 2.2719443e-01, 3.0893716e-01, 1.8606368e-01, 9.3315637e-01, 7.8037721e-01, 4.5334673e-01, 5.3903408e-02, 9.9661368e-01, 9.6257806e-01, 7.2724175e-01, 8.9716160e-01, 8.3844566e-01, 9.1933304e-01, 9.5497668e-01, 2.2522172e-02, 2.8777909e-01, 1.6518605e-01], dtype=float32))

CAODH commented 1 year ago

What is the capacity of your gpu? i think you can try use a min_memory args suit for your device.

Thanks! I changed the "min_memory" from "28000" to "2800" in the Screening.py line 82 "cmd = get_available_gpu(num_gpu=args.ngpu, min_memory=28000, sample=3, nitro_restriction=False, verbose=True)", it works. And I also want to ask how to interpret the results, does a smaller value correspond to a better compound? (['./data/sample_data/tmp_pockets/sample_compounds_Compound_1', './data/sample_data/tmp_pockets/sample_compounds_Compound_16', './data/sample_data/tmp_pockets/sample_compounds_Compound_8', './data/sample_data/tmp_pockets/sample_compounds_Compound_21', './data/sample_data/tmp_pockets/sample_compounds_Compound_13', './data/sample_data/tmp_pockets/sample_compounds_Compound_11', './data/sample_data/tmp_pockets/sample_compounds_Compound_17', './data/sample_data/tmp_pockets/sample_compounds_Compound_15', './data/sample_data/tmp_pockets/sample_compounds_Compound_19', './data/sample_data/tmp_pockets/sample_compounds_Compound_38', './data/sample_data/tmp_pockets/sample_compounds_Compound_12', './data/sample_data/tmp_pockets/sample_compounds_Compound_24', './data/sample_data/tmp_pockets/sample_compounds_Compound_39', './data/sample_data/tmp_pockets/sample_compounds_Compound_32', './data/sample_data/tmp_pockets/sample_compounds_Compound_9', './data/sample_data/tmp_pockets/sample_compounds_Compound_26', './data/sample_data/tmp_pockets/sample_compounds_Compound_30', './data/sample_data/tmp_pockets/sample_compounds_Compound_31', './data/sample_data/tmp_pockets/sample_compounds_Compound_29', './data/sample_data/tmp_pockets/sample_compounds_Compound_27', './data/sample_data/tmp_pockets/sample_compounds_Compound_35', './data/sample_data/tmp_pockets/sample_compounds_Compound_23', './data/sample_data/tmp_pockets/sample_compounds_Compound_36', './data/sample_data/tmp_pockets/sample_compounds_Compound_14', './data/sample_data/tmp_pockets/sample_compounds_Compound_22', './data/sample_data/tmp_pockets/sample_compounds_Compound_4', './data/sample_data/tmp_pockets/sample_compounds_Compound_25', './data/sample_data/tmp_pockets/sample_compounds_Compound_28', './data/sample_data/tmp_pockets/sample_compounds_Compound_34', './data/sample_data/tmp_pockets/sample_compounds_Compound_5', './data/sample_data/tmp_pockets/sample_compounds_Compound_33', './data/sample_data/tmp_pockets/sample_compounds_Compound_6', './data/sample_data/tmp_pockets/sample_compounds_Compound_10', './data/sample_data/tmp_pockets/sample_compounds_Compound_7', './data/sample_data/tmp_pockets/sample_compounds_Compound_18', './data/sample_data/tmp_pockets/sample_compounds_Compound_37', './data/sample_data/tmp_pockets/sample_compounds_Compound_20', './data/sample_data/tmp_pockets/sample_compounds_Compound_2', './data/sample_data/tmp_pockets/sample_compounds_Compound_3', './data/sample_data/tmp_pockets/sample_compounds_Compound_0'], array([5.9237815e-03, 7.2738612e-01, 8.3176845e-01, 9.9041688e-01, 6.9196236e-01, 3.4791189e-01, 3.9930293e-01, 8.8924563e-01, 8.2876543e-03, 3.6662969e-01, 3.1219095e-01, 7.0540089e-04, 9.5426762e-01, 4.1270119e-01, 9.9498761e-01, 9.2069167e-01, 2.4307099e-01, 2.1481217e-01, 9.9034542e-01, 9.5566797e-01, 8.5230125e-03, 9.3324035e-01, 9.9489176e-01, 2.2719443e-01, 3.0893716e-01, 1.8606368e-01, 9.3315637e-01, 7.8037721e-01, 4.5334673e-01, 5.3903408e-02, 9.9661368e-01, 9.6257806e-01, 7.2724175e-01, 8.9716160e-01, 8.3844566e-01, 9.1933304e-01, 9.5497668e-01, 2.2522172e-02, 2.8777909e-01, 1.6518605e-01], dtype=float32)) ################### split line it is############################## the output values is logits for Related compounds, and belong [0.0,1.0], the larger the better!

If you have any questions, you can contact me anytime. With best wishes!