Skip to content

运行hypergbm/examples/01.quick-start.ipynb时,trial会报错cannot pickle '_hashlib.HASH' object #104

@calculatechen

Description

@calculatechen

System information

  • OS Platform and Distribution : centos 7.6
  • Python version: 3.8.18
  • HyperGBM version: 0.3.0

Describe the current behavior
运行到下面这行代码时,
experiment = make_experiment(train_data.copy(), target='target', reward_metric='precision', pos_label=1,random_state=1234, max_trials=20)
会报错
Traceback (most recent call last):
File "/home/user1/anaconda3/envs/automl1/lib/python3.8/site-packages/hypernets/dispatchers/in_process_dispatcher.py", line 95, in dispatch
trial = hyper_model._run_trial(space_sample, trial_no, X, y, X_eval, y_eval, X_test, cv, num_folds, model_file,
File "/home/user1/anaconda3/envs/automl1/lib/python3.8/site-packages/hypernets/model/hyper_model.py", line 111, in _run_trial
estimator.save(model_file)
File "/home/user1/anaconda3/envs/automl1/lib/python3.8/site-packages/hypergbm/hyper_gbm.py", line 645, in save
pickle.dump(self, output, protocol=pickle.HIGHEST_PROTOCOL)
TypeError: cannot pickle '_hashlib.HASH' object
只有第一次trial能正常运行,之后的都会出现这个报错。但如果不用jupyter,而是用python运行时,上面内容就不会输出。我不清楚这个报错是否会对精度产生影响呢?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions