Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic: runtime error: cgo argument has Go pointer to Go pointer #2

Open
phuongdo opened this issue Jul 12, 2019 · 1 comment
Open

Comments

@phuongdo
Copy link

My code

  1 package main
  2
  3 import "fmt"
  4 import "github.com/ma3axaka/catboost-go"
  5 func main() {
  6     model, _:= catboost.LoadBinaryClassifierFromFile("catboost_demo.cbm")
  7      fmt.Println(err)
  8     numbers := [][]float32{{2.0, 3.0, 5.0, 7.0}}
  9     categories := [][]string{{"a", "b"}}
 10    prob, _ := model.PredictProba(numbers,4, categories,2)
 11    fmt.Println(prob)
 12 }

Here is the exception:

panic: runtime error: cgo argument has Go pointer to Go pointer

goroutine 1 [running]:
github.com/ma3axaka/catboost-go.(*Model).CalcModelPrediction.func2(0xc000010028, 0x1, 0xc000010038, 0x1, 0x1, 0x4, 0xc000010040, 0x1, 0x1, 0x2, ...)
	/home/phuongdv/gows/src/github.com/ma3axaka/catboost-go/model.go:99 +0xaf
github.com/ma3axaka/catboost-go.(*Model).CalcModelPrediction(0xc000010028, 0xc00009ff70, 0x1, 0x1, 0x4, 0xc00009ff58, 0x1, 0x1, 0x2, 0x0, ...)
	/home/phuongdv/gows/src/github.com/ma3axaka/catboost-go/model.go:99 +0x285
github.com/ma3axaka/catboost-go.(*BinaryClassifer).PredictProba(0xc00009ff30, 0xc00009ff70, 0x1, 0x1, 0x4, 0xc00009ff58, 0x1, 0x1, 0x2, 0x4a78c0, ...)
	/home/phuongdv/gows/src/github.com/ma3axaka/catboost-go/classifier.go:25 +0xab
main.main()

@lukangping
Copy link

I fix it in lukangping/catboost-go .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants