ruoqi-liu / DeepIPW

Code for paper "A deep learning framework for drug repurposing via emulating clinical trials on real world patient data" (Accepted to Nature Machine Intelligence).
MIT License
92 stars 20 forks source link

error while running the main python code #4

Open nblskr opened 1 year ago

nblskr commented 1 year ago

Hello Ruoqi, I was trying to run the DeepIPW model using the python command, but for some reason I keep getting this error:

args: Namespace(data_dir='../user_cohort/', pickles_dir='pickles', treated_drug_file=None, controlled_drug='random', controlled_drug_ratio=3, random_seed=128, batch_size=50, diag_emb_size=128, med_emb_size=128, med_hidden_size=64, diag_hidden_size=64, learning_rate=0.001, weight_decay=1e-06, epochs=10, save_model_filename='tmp/1346823.pt', outputs_lstm=None, outputs_lr=None, save_db=None, cuda=False, device=device(type='cpu')) Traceback (most recent call last): File "C:\Users\nabil\Study\Research\code\DeepIPW-master\deep-ipw\main.py", line 326, in <module> main(args=parse_args()) File "C:\Users\nabil\Study\Research\code\DeepIPW-master\deep-ipw\main.py", line 47, in main output_lstm = open(args.outputs_lstm, 'a') TypeError: expected str, bytes or os.PathLike object, not NoneType

I'm not sure what's wrong

thank you very much,

QinQG commented 4 months ago

你好,该问题是作者没有详细的指出数据参数的设置,--data_dir ;--treated_drug_file;--save_model_filename;--outputs_lstm;--outputs_lr;--save_db都需要设置,作者在运行启动程序run_lstm.sh中有写道,但并没有在main中提及。