# Ray\_xgboost on K8

**URL:** <https://discuss.ray.io/t/ray-xgboost-on-k8/1744>\
**Category:** Kubernetes\
**Created:** [April 15, 2021, 3:18pm UTC](https://discuss.ray.io/t/ray-xgboost-on-k8/1744 "2021-04-15T15:18:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ecorro](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/ecorro/32/4712_2.png) [@ecorro](https://discuss.ray.io/u/ecorro)\
**Post date:** [April 15, 2021, 3:18pm UTC](https://discuss.ray.io/t/ray-xgboost-on-k8/1744/1 "2021-04-15T15:18:02Z")

</div>

Hi, i’m trying to run xgboost\_ray on a Ray cluster deployed on K8. The connection to the K8 cluster works properly but when I try to run xgboost\_ray I get `"Exception iterating responses: No module named 'xgboost_ray'"` . I’m using the Ray Kubernetes Operator and the Docker image I used to deploy Ray on the K8 cluster is `"rayproject/ray-ml"` Here my code and error. Thanks in advance for your help.

```
import ray
import ray.util
import os
import time
from xgboost_ray import train, RayDMatrix, RayParams
import pandas as pd
ray.util.connect("127.0.0.1:50051") 
colnames = ["label"] + ["feature-%02d" % i for i in range(1, 29)]
df = pd.read_csv("HIGGS.csv.gz", names=colnames)
dtrain = RayDMatrix(df, label="label",)
config = {
    "tree_method": "hist",
    "eval_metric": ["logloss", "error"],
}
evals_result = {}
start = time.time()
bst = train(
    config,
    dtrain,
    evals_result=evals_result,
    ray_params=RayParams(max_actor_restarts=1),
    num_boost_round=100,
    evals=[(dtrain, "train")])
taken = time.time() - start
print(f"TRAIN TIME TAKEN: {taken:.2f} seconds")
bst.save_model("higgs.xgb")
print("Final training error: {:.4f}".format(
    evals_result["train"]["error"][-1]))

```

> Got Error from data channel – shutting down: \<\_MultiThreadedRendezvous of RPC that terminated with:  
> status = StatusCode.UNKNOWN  
> details = “Exception iterating responses: No module named ‘xgboost\_ray’”  
> debug\_error\_string = “{“created”:”@1618494050.585477971",“description”:“Error received from peer ipv4:127.0.0.1:50051”,“file”:“src/core/lib/surface/call.cc”,“file\_line”:1067,“grpc\_message”:“Exception iterating responses: No module named ‘xgboost\_ray’”,“grpc\_status”:2}"
> 
> > 
> 
> Exception in thread Thread-8:  
> Traceback (most recent call last):  
> File “/home/vmuser/miniconda3/envs/anyscale/lib/python3.7/threading.py”, line 926, in \_bootstrap\_inner  
> self.run()  
> File “/home/vmuser/miniconda3/envs/anyscale/lib/python3.7/threading.py”, line 870, in run  
> self.\_target(\*self.\_args, \*\*self.\_kwargs)  
> File “/home/vmuser/miniconda3/envs/anyscale/lib/python3.7/site-packages/ray/util/client/dataclient.py”, line 76, in \_data\_main  
> raise e  
> File “/home/vmuser/miniconda3/envs/anyscale/lib/python3.7/site-packages/ray/util/client/dataclient.py”, line 61, in \_data\_main  
> for response in resp\_stream:  
> File “/home/vmuser/miniconda3/envs/anyscale/lib/python3.7/site-packages/grpc/\_channel.py”, line 426, in **next**  
> return self.\_next()  
> File “/home/vmuser/miniconda3/envs/anyscale/lib/python3.7/site-packages/grpc/\_channel.py”, line 826, in \_next  
> raise self  
> grpc.\_channel.\_MultiThreadedRendezvous: \<\_MultiThreadedRendezvous of RPC that terminated with:  
> status = StatusCode.UNKNOWN  
> details = “Exception iterating responses: No module named ‘xgboost\_ray’”  
> debug\_error\_string = “{“created”:”@1618494050.585477971",“description”:“Error received from peer ipv4:127.0.0.1:50051”,“file”:“src/core/lib/surface/call.cc”,“file\_line”:1067,“grpc\_message”:“Exception iterating responses: No module named ‘xgboost\_ray’”,“grpc\_status”:2}"

---

<div class="post-metadata">

**Author:** ![sangcho](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sangcho/32/425_2.png) [@sangcho](https://discuss.ray.io/u/sangcho)\
**Post date:** [April 15, 2021, 5:40pm UTC](https://discuss.ray.io/t/ray-xgboost-on-k8/1744/2 "2021-04-15T17:40:04Z")

</div>

cc @kai It is the xgboost related question!

---

<div class="post-metadata">

**Author:** ![tppalani](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/tppalani/32/5590_2.png) [@tppalani](https://discuss.ray.io/u/tppalani)\
**Post date:** [January 9, 2024, 5:23pm UTC](https://discuss.ray.io/t/ray-xgboost-on-k8/1744/3 "2024-01-09T17:23:46Z")

</div>

Hi @ecorro will you able to resolve the issue ?
