首页 > 解决方案 > H2o Packge 错误:无法执行助推器操作:更新程序在节点 /127.0.0.1:54321 上处于非活动状态

问题描述

我在 python 中使用 H2o 包运行 xgboost。我设置使用我机器的所有 32 个内核。分类器位于 for 循环中,用于针对不同参数运行分类。我正在启动 h2o 并在循环中关闭它。它在循环中运行 2-3 轮,并在某些运行中返回错误“无法执行助推器操作:更新程序在节点 /127.0.0.1:54321 上处于非活动状态”。有人知道为什么我会收到这样的错误吗?

谢谢, 埃尔纳兹

`for dates in start_end_dates:
     for window_size in window_sizes:
          print dates[0], dates[1], dates[2], window_size
          model_string = str(dates[0])+ '_'+ str(dates[1]) + ':'+ str(dates[2])+ ':'+ str(window_size)
    ## load daily transaction types 
         ## this function runs in parallel on all cpus 
         daily_transactions_type_df = transform_transactions_types.transform(dates[0], dates[1], window_size)
         ##load daily transactions
         ## this function runs in parallel on all cpus 
         daily_transactions_df = transfrom_daily_transactions.transform(dates[0], dates[1], window_size, max_number_of_instrument)

         snapshot_date = dates[1]
         ## user status list
         user_status_list = Classification_helpers.load_user_status_data_from_gbq(snapshot_date)
    user_status_list

         ## Normalize the data
         numeric_columns = daily_transactions_type_df.iloc[:,1:].columns.tolist()  
        other_columns = []
        daily_transactions_type_df_norm = Classification_helpers.normalize_data_without_outliers(daily_transactions_type_df, numeric_columns, other_columns)

        ## Normalize the data
        numeric_columns = daily_transactions_df.iloc[:,1:-6].columns.tolist()  
        other_columns = daily_transactions_df.iloc[:,-5:].columns.tolist()
        daily_transactions_df_norm =   Classification_helpers.normalize_data_without_outliers(daily_transactions_df,numeric_columns,other_columns)

        data_frames = [daily_transactions_type_df_norm,   daily_transactions_df_norm, user_status_list[['USER_ID', 'label']]]

        df = Classification_helpers.create_labelled_data(data_frames)
        numeric_columns = df.iloc[:,1:-6].columns.tolist()  
        other_columns = df.iloc[:,-6:-1].columns.tolist()  

        nthreads = -1
        Classification_helpers.init_h2o(nthreads)

         model, performance, predictions = Classification_helpers.train_XGboost(df, numeric_columns, other_columns, model_string)
    print performance.auc()`

标签: pythonh2oxgboost

解决方案


使用Flow接口观看动作:http: //127.0.0.1 :54321 ,注意内存使用。

有关您应该观看的屏幕,请参阅 http://docs.h2o.ai/h2o/latest-stable/h2o-docs/flow.html#viewing-cluster-status 。您将看到每个节点上的可用内存量实时更新。


如果没有更多信息,一种猜测是您的内存不足,因为您在 for 循环的每次迭代中使用了更多内存。

如果是这样,很难在不了解您在 for 循环中所做的事情的情况下给出建议;但如果训练数据相同,请确保在 for 循环之外加载。在最坏的情况下,您应该在 for 循环中执行 H2O 初始化和关闭(并在每次迭代结束时保存您的模型,以备后用)。

哦,还有一种可能性,因为你没有提到它:在你的 h2o.init() 调用中明确指定给 H2O 多少内存。你可能会发现你可以放弃它而不是默认值。(但不要把机器的内存全部给H2O,否则一切都会变得不稳定!)


推荐阅读