theislab / cpa

The Compositional Perturbation Autoencoder (CPA) is a deep generative framework to learn effects of perturbations at the single-cell level. CPA performs OOD predictions of unseen combinations of drugs, learns interpretable embeddings, estimates dose-response curves, and provides uncertainty estimates.
BSD 3-Clause "New" or "Revised" License
76 stars 17 forks source link

Autotuner not saving results #54

Open pgm99 opened 6 days ago

pgm99 commented 6 days ago

Hi, I'm trying to use your Hyperparameter tuner. I set the tuning for 600 runs and 175 epochs, obtaining 53 failed trials. When I tried to load my results using Pickle I found that it failed saving the .pkl file. Also, in the log file I found a "Ran out of input" error. Is this happening because the 53 failed trials, or is something wrong with the code? Thanks in advance

(this code is right after running run_autotune)

model_pkl_file = "/cpa_test/test/output/result_grid.pkl"

result_grid = experiment.result_grid

with open(model_pkl_file, 'wb') as f:
        pickle.dump(result_grid, f)
print(f"Data has been written to '{model_pkl_file}' using pickle.")

with open(model_pkl_file, 'rb') as file:
        loaded_data = pickle.load(file)
print("Data loaded from the file:", loaded_data)
ArianAmani commented 4 days ago

Hi, thanks for your interest! Could you share the logs and the error you are getting? Also, it is best if you use WandB for logging the runs, so you won't lose the data and the logs, even if your session breaks because of memory issues, or any unknown problems! That's what I always do personally. It's available in the example script with logging in to your wandb account on command line and setting the wandb parameter to True.