jolibrain / deepdetect

Deep Learning API and Server in C++14 support for Caffe, PyTorch,TensorRT, Dlib, NCNN, Tensorflow, XGBoost and TSNE
https://www.deepdetect.com/
Other
2.51k stars 561 forks source link

Multiple number of classes is unknown (nclasses == 0) #599

Closed ComputerCarl closed 5 years ago

ComputerCarl commented 5 years ago

When I attempt to add several of the services, I get the error specified in the title. Sorry, I am new at ML.

Configuration

beniz commented 5 years ago

Hi, can you share the exact API calls you are making to the server ?

ComputerCarl commented 5 years ago

Sure! Fore example, when attempting to register the real_age service from the models page. The /opt/models/age_real directory already contains;

config.json
deploy.prototxt
model.caffemodel

And this is what I enter (minus init and create_repository lines because I already downloaded and unzipped the files)

curl -X PUT 'http://localhost:8080/services/age_real' -d '{
 "description": "age estimation service",
 "model": {
  "repository": "/opt/models/age_real"
 },
 "mllib": "caffe",
 "type": "supervised",
 "parameters": {
  "input": {
   "connector": "image"
  }
 }
}'

I get response

{"status":{"code":400,"msg":"BadRequest","dd_code":1006,"dd_msg":"Service Bad Request Error: number of classes is unknown (nclasses == 0)"}}
ComputerCarl commented 5 years ago

Please hold off on responding.. I think I know where I messed up and am experimenting.

dgtlmoon commented 4 years ago

For others who hit this

"parameters": { needs however many classes you trained on

>   "mllib": {
>    "nclasses": 2
>   }