Hi John,
thanks for answering.
Maybe I missed anything in the description?
I wrote the commands and the log (console output)
How did you try to access the endpoint? Via curl?
In Python, I ran the following with many variation of the data:
import requests
from typing import Any
import numpy as np
import json
url = "
"
raw_input = json.dumps([1, 2])  # This becomes a JSON string like "[1, 2]"
response = requests.post(
    url=url,
    headers={
        'accept': 'application/json',
        'Content-Type': 'application/json'
    },
    json=raw_input
)
print(response.status_code, response.json())
And always got:
422 {'detail': "Error [<class 'ValueError'>] processing request: Expected 2D array, got scalar array instead:\narray={'x0': 1, 'x1': 2}.\nReshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample."}
or:
422 {'detail': [{'type': 'bytes_type', 'loc': ['body', 'bytes'], 'msg': 'Input should be a valid bytes', 'input': [{'x0': 1, 'x1': 2}], 'url': '
'}, {'type': 'dict_type', 'loc': ['body', 'dict[any,any]'], 'msg': 'Input should be a valid dictionary', 'input': [{'x0': 1, 'x1': 2}], 'url': '
So, I went to the link None in order to use it like Postman. Testing the API without using Python. It was ChatGPT that directed me there, and it is kind of a nice way to validate the API
Thanks! I'm curious, why do you have /docs#/ in the url
And that is the bottom of the screenshot that I've shared (light green background)
Can you add such an attempt and the outputs please?
Hi @<1838387863251587072:profile|JealousCrocodile85> , can you please add the specific commands you ran and the full console output of this?
I'm mostly with agreement with you on that  🙂
ClearML has a great documentation. But now that I've tried it all, I gave ChatGPT a shot. It got me introduced to the /docs#/, which is kind of a nice way to test the API.
But the issue still remains and I cannot finish my POC  😞
Its a bit confusing, please add the full list of action you took + whatever the console printed.
Preferably using the following format for logs
This is a very convenient way to post logs 
Hi  @<1523701070390366208:profile|CostlyOstrich36>
Sorry for the delayed response.
No errors in the serving containers.
I did follow the link you've shared before posting. I ran the following:curl.exe -X POST " None " -H "accept: application/json" -H "Content-Type: application/json" -d '{"x0": 1, "x1": 2}'
(note that I'm using port 8082, since 8080 is already taken by ClearML Server on this VM).
and got the following response:
{"detail":[{"type":"json_invalid","loc":["body",1],"msg":"JSON decode error","input":{},"ctx":{"error":"Expecting property name enclosed in double quotes"}}]}
So I fixed it by changing:-d '{"x0": 1, "x1": 2}'
to:'{\"x0\": 1, \"x1\": 2}'
And I'm back to the original issue I had (in the image), with the log:
{"detail":"Error [<class 'ValueError'>] processing request: Expected 2D array, got scalar array instead:\narray={'x0': 1, 'x1': 2}.\nReshape your data either using array.reshape(-1, 1) if you
r data has a single feature or array.reshape(1, -1) if it contains a single sample."}
Am I the only one encountering it? 😞
Sorry for the trouble, you are right. Now it looks much better.
Please let me know if it still needs explanation or information
So, I went to the link
in order to use it like Postman. Testing the API without using Python. It was ChatGPT that directed me there, and it is kind of a nice way to validate the API
I would ignore anything that ChatGPT says about ClearML (and most other things too)

 
				