Skip to content

Commit

Permalink
Fix invalid param value "use_gpu":"true"
Browse files Browse the repository at this point in the history
After installing latest Jupyter notebooke, the json format check is strick, due to passing a string value "true"

for the "use_gpu":"true", "use_gpu": True is required.

```
params = {
    "tree_method": "gpu_hist",
    "grow_policy": "depthwise",
    "num_workers": 1,
    "use_gpu": "true",
}
```
TypeError: Invalid param value given for param "use_gpu".

Boolean Param requires value of type bool. Found <class 'str'>.

More over, "use_gpu": True is deprecated in dmlc/XGBoost, change to user "device": "cuda" instead

Signed-off-by: Tim Liu <[email protected]>
  • Loading branch information
NvTimLiu committed May 21, 2024
1 parent 6436748 commit 3e5fd9b
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
" \"tree_method\": \"gpu_hist\",\n",
" \"grow_policy\": \"depthwise\",\n",
" \"num_workers\": 1,\n",
" \"use_gpu\": \"true\",\n",
" \"device\": \"cuda\",\n",
"}\n",
"params['features_col'] = features\n",
"params['label_col'] = label\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@
" \"tree_method\": \"gpu_hist\",\n",
" \"grow_policy\": \"depthwise\",\n",
" \"num_workers\": 1,\n",
" \"use_gpu\": \"true\",\n",
" \"device\": \"cuda\",\n",
"}\n",
"params['features_col'] = features\n",
"params['label_col'] = label\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
" \"tree_method\": \"gpu_hist\",\n",
" \"grow_policy\": \"depthwise\",\n",
" \"num_workers\": 1,\n",
" \"use_gpu\": \"true\",\n",
" \"device\": \"cuda\",\n",
"}\n",
"\n",
"params['features_col'] = features\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
" \"tree_method\": \"gpu_hist\",\n",
" \"grow_policy\": \"depthwise\",\n",
" \"num_workers\": 1,\n",
" \"use_gpu\": \"true\",\n",
" \"device\": \"cuda\",\n",
"}\n",
"params['features_col'] = features\n",
"params['label_col'] = label\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
" \"tree_method\": \"gpu_hist\",\n",
" \"grow_policy\": \"depthwise\",\n",
" \"num_workers\": 1,\n",
" \"use_gpu\": \"true\",\n",
" \"device\": \"cuda\",\n",
"}\n",
"params['features_col'] = features\n",
"params['label_col'] = label\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
" \"tree_method\": \"gpu_hist\",\n",
" \"grow_policy\": \"depthwise\",\n",
" \"num_workers\": 1,\n",
" \"use_gpu\": \"true\",\n",
" \"device\": \"cuda\",\n",
"}\n",
"params['features_col'] = features\n",
"params['label_col'] = label\n",
Expand Down

0 comments on commit 3e5fd9b

Please sign in to comment.