huawei-noah / HEBO

Bayesian optimisation & Reinforcement Learning library developped by Huawei Noah's Ark Lab

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can only concatenate str (not "NoneType") to str

futianfan opened this issue · comments

Dear authors,

when i run the command "./weighted_retraining/scripts/robust_opt/robust_opt_chem.sh", i got the following error, do you know how to fix it? thanks

python ./weighted_retraining/weighted_retraining/robust_opt_scripts/robust_opt_chem.py --seed=3 --gpu --query_budget=500 --retraining_frequency=50 --pretrained_model_file=./weighted_retraining/assets/pretrained_models/chem_vanilla/chem.ckpt --pretrained_model_id vanilla --batch_size 128 --lso_strategy=opt --train_path=weighted_retraining/data/chem/zinc/orig_model/tensors_train --val_path=weighted_retraining/data/chem/zinc/orig_model/tensors_val --vocab_file=weighted_retraining/data/chem/zinc/orig_model/vocab.txt --property_file=weighted_retraining/data/chem/zinc/orig_model/pen_logP_all.pkl --n_retrain_epochs=0.1 --latent_dim 56 --beta_target_pred_loss 10 --target_predictor_hdims [128,128] --metric_loss triplet --metric_loss_kw {'threshold':.1} --beta_metric_loss 1 --beta_final 0.001 --n_init_retrain_epochs=1 --n_best_points=2000 --n_rand_points=8000 --n_inducing_points=500 --samples_per_model 0 --weight_type=rank --rank_weight_k=1e-3 --acq-func-id ExpectedImprovement --acq-func-kwargs {} --acq-func-opt-kwargs {'batch_limit':25} --use_pretrained
r=50 k=1e-3 seed=4
Traceback (most recent call last):
File "./weighted_retraining/weighted_retraining/robust_opt_scripts/robust_opt_chem.py", line 1115, in
main()
File "./weighted_retraining/weighted_retraining/robust_opt_scripts/robust_opt_chem.py", line 525, in main
acq_func_kwargs=args.acq_func_kwargs,
File "./weighted_retraining/weighted_retraining/robust_opt_scripts/robust_opt_chem.py", line 351, in get_path
pretrained_model_id=pretrained_model_id
File "./weighted_retraining/weighted_retraining/robust_opt_scripts/robust_opt_chem.py", line 250, in get_root_path
exp_spec += '-' + METRIC_LOSSES[metric_loss]'exp_metric_id'
TypeError: can only concatenate str (not "NoneType") to str

Hi @futianfan,

Thank you for raising this issue, the problem occurs because the method exp_metric_id of TripletLossTorch did not have a default return value. Now it's fixed.

Best,
Antoine