Closed GemmaTuron closed 1 year ago
Hi @emmakodes
Sorry I dont not understand in which cases you get the error, since you did change the api to run? Can you explain more in detail?
Yes @GemmaTuron I will do that. I want to push my changes to my fork so that you see my run.sh and service.py that works
Hello @GemmaTuron Here is the code in my fork that works: https://github.com/emmakodes/eos7w6n
Currently, the model has the following code in run.sh
and service.py
which works(Model fetch and make prediction successfully):
run.sh
python grover/scripts/save_features.py --data_path data.csv \
--save_path features.npz \
--features_generator rdkit_2d_normalized \
--restart
python grover/main.py fingerprint --data_path data.csv \
--features_path features.npz \
--checkpoint_path ../checkpoints/grover_large.pt \
--fingerprint_source both \
--output fp.npz \
--no_cuda \
service.py:
lines = [
"python {0}/code/scripts/save_features.py --data_path {1} --save_path {2} --features_generator rdkit_2d_normalized --restart".format(
self.framework_dir,
data_file,
features_file,
),
"python {0}/code/main.py fingerprint --data_path {1} --features_path {2} --checkpoint_path {3}/grover_large.pt --fingerprint_source both --output {4} --no_cuda".format(
self.framework_dir,
data_file,
features_file,
self.checkpoints_dir,
pred_file
)
]
But if you notice, the run.sh
is not accepting any command line argument and service.py
does not point to run.sh
but they work
When I try to edit run.sh
to accept command line values and service.py
to point to run.sh
file then I get this error log without any output.
eos7w6n_fetch.log
My edit run.sh
python $1/code/scripts/save_features.py --data_path $2 \
--save_path $1/features.npz \
--features_generator rdkit_2d_normalized \
--restart
python $1/code/main.py fingerprint --data_path $2 \
--features_path $1/features.npz \
--checkpoint_path $1/../checkpoints/grover_large.pt \
--fingerprint_source both \
--output $1/fp.npz \
--no_cuda \
My edit service.py:
lines = [
"bash {0}/run.sh {0} --data_path {1} --save_path {2} --features_generator rdkit_2d_normalized --restart".format(
self.framework_dir,
data_file,
features_file,
),
"bash {0}/run.sh {0} fingerprint --data_path {1} --features_path {2} --checkpoint_path {3}/grover_large.pt --fingerprint_source both --output {4} --no_cuda".format(
self.framework_dir,
data_file,
features_file,
self.checkpoints_dir,
pred_file
)
]
I installed the model source code from the author's repo to my system to see how it works. I ran predictions for smiles csv and I get the following logs:
grover.txt
same logs I got when I edited run.sh
and service.py
files above but with an output fp.npz
. I guess the fp.npz
output is the output predictions but saved as a numpy array.
@GemmaTuron In summary, run.sh
and service.py
works with the following code I have now in my forked repo run.sh service.py but when I edit run.sh to accept command line values and service.py to point to run.sh file then I get same log as running the author's source but without any output predictions.
I see! @miquelduranfrigola do you think we could leave it as it is?
@emmakodes
Let's not touch it, leave the original piece of code and we'll live with that to avoid further issues. If there are minor changes done (like, removing unnecessary files, adapting the .gitattributes) open a PR and we'll merge it
Okay @GemmaTuron let me do those now and open a PR
Hello @GemmaTuron I have made the PR
This model is completed!
Hello, @GemmaTuron this model didn't work initially because
conda install -c conda-forge rdkit=2021.03.4
was failing. So I had to instead usepip install rdkit==2023.3.1
and it was able to fetch and make predictions successfully. I changed the api to run in service.py since it was using the predict method. The model was able to fetch and make predictions successfully using the run api:eos7w6n_pred.csv eos7w6n_fetch_log.txt
When I try to edit
run.sh
to accept command line values andservice.py
to point to run.sh file, I get the following error: eos7w6n_fetch.log (I upload the file because it might be too long to post the error message)