ersilia-os / eos5xng

GNU General Public License v3.0
0 stars 0 forks source link

testing #6

Closed Richiio closed 10 months ago

Richiio commented 10 months ago

@GemmaTuron , These are the changes I have made

Richiio commented 10 months ago

@GemmaTuron In some really interesting turn of events, it's working but it didn't on my local

GemmaTuron commented 10 months ago

Can you share more about the error in your local?

GemmaTuron commented 10 months ago

@Richiio

Questions:

GemmaTuron commented 10 months ago

@Richiio

Some more pointers for you to work during the day:

tip: in save_features.py line 66, this piece of code is probably giving you issues: temp_save_dir = args.save_path + '_temp' - it is adding this _temp to the save path, so you either pass it as well or simply temp_save_dir = args.save_path

I hope this is helpful. Please work on the code and report here what you have tried to make this work. Thanks!

Richiio commented 10 months ago

@GemmaTuron the one fold(fold_0) in the authors code contains an ensemble of four models which is what is contained in my code. I basically just shortened the paths it takes in finding the models

Richiio commented 10 months ago

IMG-20231221-WA0033.jpg

This is the error I get in my local. I asked Leila to help test to confirm the error was universal and not just on my local because it worked on Hellen's system but not on mine

Richiio commented 10 months ago

For save_features.py I didn't write any of that code, it was gotten off chemprop. I didn't edit the service.py file again

GemmaTuron commented 10 months ago

Hi @Richiio Please do not paste screenshots as these are difficult to follow, use always .txt files. Good to ask for help to peers, thanks for that. I am not sure why we decided to change back to using a main.py, I thought we had discussed to just keep a modified run.sh? In any case, both options are fine. I still think you need to add print statements throughout your code in main.py and in the scripts files as well to see the paths, since it simply seems an error in the paths - please try that and check what you are getting. I mean, add print(tmp_folder) or whatever that is at every step of your code so you can follow it I still think this piece temp_save_dir = args.save_path + '_temp' might be the cause of the problems.

Richiio commented 10 months ago

I did add the print statements for my local but no file was being created in the predict.py script for my local and that was why we were getting the error, no such file or directory. This occured when we were opening the temp_output and pointing to the second column containing the scores

I decided to use the main.py as with run.sh, we were returning smiles and scores. Hence the reason for null and score in the initial commit. My guess was chemprop returns the smiles and scores. I'm open to be corrected here. Hence the main.py file was to read through our temporal file and store all scores which is our second column r[1] in outputs, then write the results to output_file, then return output_file

GemmaTuron commented 10 months ago

Hi @Richiio

A file is being created somewhere, so if you print the paths you might be able to find out which path is it looking for. As I said, please revise that the path is not being modified at some step of the script (I have already pointed out to a piece of code that could be the cause) and hence causing you not to find it. If you do not provide me with more information of the tests you are doing and the print statements you are using to see where the files are being generated I cannot help further. Let me know if you can follow up on the suggestion to look into line 66 of the script save_features - IT is modifying the path to save the files.

GemmaTuron commented 10 months ago

More things to check @Richiio let's see if we get to the bottom of this: From the error on Leila's screen (please, paste a log file if you can) it seems the model is not being able to load correctly. I'd not, just in case, edit the folder of the model. Please leave it as it was in the original repo because chemprop expects a certain structure that it might not be finding now

GemmaTuron commented 10 months ago

I have also made some tests: the first error is for sure on the indicated line 66 as it is adding a _temp suffix which you then don't account for anywhere. Please remove that and work from there, it is almost done just a matter of figuring out the right combination! You almost got it, just some more work -remember to always use directly run.sh to test changes more quickly

Richiio commented 10 months ago

Alright @GemmaTuron I'll work on that

Richiio commented 10 months ago

I cloned my repo and got the needed output @GemmaTuron

(eos5xng) richiio@Richio:~$ git clone https://github.com/Richiio/eos5xng.git
Cloning into 'eos5xng'...
remote: Enumerating objects: 447, done.
remote: Counting objects: 100% (132/132), done.
remote: Compressing objects: 100% (112/112), done.
remote: Total 447 (delta 32), reused 90 (delta 14), pack-reused 315
Receiving objects: 100% (447/447), 2.62 MiB | 1.67 MiB/s, done.
Resolving deltas: 100% (97/97), done.
Updating files: 100% (313/313), done.
Filtering content: 100% (5/5), 202.03 MiB | 7.36 MiB/s, done.
(eos5xng) richiio@Richio:~$ cd eos5xng
(eos5xng) richiio@Richio:~/eos5xng$ cd model
(eos5xng) richiio@Richio:~/eos5xng/model$ cd framework
(eos5xng) richiio@Richio:~/eos5xng/model/framework$ bash run.sh . ~/Desktop/testt.csv ~/Desktop/output.csv
100%|███████████████████████████████████████████████████████████████████████████████| 2955/2955 [01:43<00:00, 28.45it/s]
Loading training args
Loading data
2955it [00:00, 107154.81it/s]
100%|████████████████████████████████████████████████████████████████████████████| 2955/2955 [00:00<00:00, 79445.21it/s]
Validating SMILES
Test size = 2,955
Predicting with an ensemble of 5 models
  0%|                                                                                             | 0/5 [00:00<?, ?it/s]Loading pretrained parameter "encoder.encoder.cached_zero_vector".
Loading pretrained parameter "encoder.encoder.W_i.weight".
Loading pretrained parameter "encoder.encoder.W_h.weight".
Loading pretrained parameter "encoder.encoder.W_o.weight".
Loading pretrained parameter "encoder.encoder.W_o.bias".
Loading pretrained parameter "ffn.1.weight".
Loading pretrained parameter "ffn.1.bias".
Loading pretrained parameter "ffn.4.weight".
Loading pretrained parameter "ffn.4.bias".
 20%|████████████████▊                                                                   | 1/5 [09:33<38:13, 573.33s/it]
Loading pretrained parameter "encoder.encoder.cached_zero_vector".
Loading pretrained parameter "encoder.encoder.W_i.weight".
Loading pretrained parameter "encoder.encoder.W_h.weight".
Loading pretrained parameter "encoder.encoder.W_o.weight".
Loading pretrained parameter "encoder.encoder.W_o.bias".
Loading pretrained parameter "ffn.1.weight".
Loading pretrained parameter "ffn.1.bias".
Loading pretrained parameter "ffn.4.weight".
Loading pretrained parameter "ffn.4.bias".
 40%|█████████████████████████████████▌                                                  | 2/5 [11:30<15:15, 305.01s/it]
Loading pretrained parameter "encoder.encoder.cached_zero_vector".
Loading pretrained parameter "encoder.encoder.W_i.weight".
Loading pretrained parameter "encoder.encoder.W_h.weight".
Loading pretrained parameter "encoder.encoder.W_o.weight".
Loading pretrained parameter "encoder.encoder.W_o.bias".
Loading pretrained parameter "ffn.1.weight".
Loading pretrained parameter "ffn.1.bias".
Loading pretrained parameter "ffn.4.weight".
Loading pretrained parameter "ffn.4.bias".
 60%|██████████████████████████████████████████████████▍                                 | 3/5 [12:40<06:35, 197.56s/it]
Loading pretrained parameter "encoder.encoder.cached_zero_vector".
Loading pretrained parameter "encoder.encoder.W_i.weight".
Loading pretrained parameter "encoder.encoder.W_h.weight".
Loading pretrained parameter "encoder.encoder.W_o.weight".
Loading pretrained parameter "encoder.encoder.W_o.bias".
Loading pretrained parameter "ffn.1.weight".
Loading pretrained parameter "ffn.1.bias".
Loading pretrained parameter "ffn.4.weight".
Loading pretrained parameter "ffn.4.bias".
 80%|███████████████████████████████████████████████████████████████████▏                | 4/5 [13:39<02:23, 143.12s/it]
Loading pretrained parameter "encoder.encoder.cached_zero_vector".
Loading pretrained parameter "encoder.encoder.W_i.weight".
Loading pretrained parameter "encoder.encoder.W_h.weight".
Loading pretrained parameter "encoder.encoder.W_o.weight".
Loading pretrained parameter "encoder.encoder.W_o.bias".
Loading pretrained parameter "ffn.1.weight".
Loading pretrained parameter "ffn.1.bias".
Loading pretrained parameter "ffn.4.weight".
Loading pretrained parameter "ffn.4.bias".
100%|████████████████████████████████████████████████████████████████████████████████████| 5/5 [14:39<00:00, 175.92s/it]
Saving predictions to /tmp/ersilia-d2wry68p/output.csv
Elapsed time = 0:14:42
GemmaTuron commented 10 months ago

so the model is generating an output file, /tmp/ersilia-d2wry68p/output.csv have you checked that this is actually created and that there is a .csv file there? Did you remove the addition of "-temp" to get here?

Richiio commented 10 months ago

Yes it did, I'll have to check why it didn't at first.

Richiio commented 10 months ago

I know images aren't advised but here is my folder directory

IMG_20231222_174836_259.jpg

Richiio commented 10 months ago

The temp was used when we were saving features for our model to run predictions on. It was not used for the output of our model. I got the above from leaving the temp file. When I removed the line of code. My features file wasn't being saved.

Richiio commented 10 months ago

Hi @GemmaTuron. But we can test the model to ensure it works and produces the required output.