Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

run deeprank on data without target values (test mode) #213

Closed
manonreau opened this issue Jan 14, 2021 · 1 comment
Closed

run deeprank on data without target values (test mode) #213

manonreau opened this issue Jan 14, 2021 · 1 comment

Comments

@manonreau
Copy link
Contributor

Describe the bug
I ran a pre-trained model on data for which I do not have any known target values. Yet, Deeprank does require target values and sends back an error.

To Reproduce

  1. the data I use can be retrieved on cartesius : /projects/0/deeprank/3deepface/physiological_homodimers_benchmark/generate_grids/*hdf5
  2. use the true/false interface pre-trained model best_model.pth.tar (/projects/0/deeprank/data_for_paper/exp1_classification/output/cross_validation/best_model.pth.tar)
  3. run the following script to generate the model
 """                                                                                                                                       
Test 3DeepFace models                                                                                                                              
"""
import os
import sys
import glob
from deeprank.learn import *
# to set your own architecture                                                                                                                          
from arch_001_02 import cnn_class as cnn3d_class
################################################################################                                                                                                 
# input and output settings                                                                                                                           
################################################################################                                                                                                 
# You need to add path for the dataset                                                                                                                      
database = glob.glob('./generate_grids/*hdf5')
# You need to set it as your output path                                                                                                                     
outpath = './run_model'
################################################################################                                                                                                 
# Start the training                                                                                                                               
################################################################################                                                                                                 
model = NeuralNet(database,cnn3d_class,pretrained_model='best_model.pth.tar', outdir=outpath)
model.test()

Expected Results

  • For prospective research purpose, the user should be allowed to use data with features only and no target information.
  • The hitrate should not be automatically computed if no target values are provided by the user

Actual Results or Error Info

File "run_learn_gpu.py", line 27, in <module>
  model = NeuralNet(database,cnn3d_class,pretrained_model='best_model.pth.tar', outdir=outpath)
 File "/nfs/home2/mfreau/software/deeprank/deeprank/learn/NeuralNet.py", line 142, in __init__
  self.data_set.process_dataset()
 File "/nfs/home2/mfreau/software/deeprank/deeprank/learn/DataSet.py", line 280, in process_dataset
  self.get_input_shape()
 File "/nfs/home2/mfreau/software/deeprank/deeprank/learn/DataSet.py", line 764, in get_input_shape
  feature, _ = self.load_one_molecule(fname)
 File "/nfs/home2/mfreau/software/deeprank/deeprank/learn/DataSet.py", line 1121, in load_one_molecule
  target = mol_data.get('targets/' + self.select_target)[()]
TypeError: 'NoneType' object is not subscriptable
@manonreau
Copy link
Contributor Author

Solved by PR #242

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant