comet-ml / issue-tracking

Questions, Help, and Issues for Comet ML
https://www.comet.ml
85 stars 7 forks source link

Bad request for requesting model names in registry #525

Closed baniasbaabe closed 11 months ago

baniasbaabe commented 11 months ago

Describe the Bug

Whenever I run api.get_registry_model_names(os.environ.get("COMET_WORKSPACE")) I get the following error:

comet_ml.exceptions.CometRestApiException: GET https://www.comet.com/api/rest/v2/registry-model failed with status code 400: Bad Request (Constraint-Violation)

A similar error occurs when I run api.get_registry_model_details("myworkspace", "mymodelname")

Expected behavior

I should get the model names in my model registry

Where is the issue?

To Reproduce

Steps to reproduce the behavior:

import os
from comet_ml import API

api = API(os.environ.get("COMET_API_KEY"))
print(api.get_registry_model_names(os.environ.get("COMET_WORKSPACE")))

Stack Trace

If possible please include the full stack trace of your issue here

Traceback (most recent call last):
  File ".\src\inference_pipeline\main.py", line 14, in <module>
    print(api.get_registry_model_names(os.environ.get("COMET_WORKSPACE")))
  File "C:\Users\User\AppData\Local\pypoetry\Cache\virtualenvs\projectxyz-G6zllvL5-py3.8\lib\site-packages\comet_ml\api.py", line 3946, in get_registry_model_names
    model["modelName"] for model in self._client.get_registry_models(workspace)
  File "C:\Users\User\AppData\Local\pypoetry\Cache\virtualenvs\projectxyz-G6zllvL5-py3.8\lib\site-packages\comet_ml\connection.py", line 3964, in get_registry_models
    response = self.get_from_endpoint("registry-model", params)
  File "C:\Users\User\AppData\Local\pypoetry\Cache\virtualenvs\projectxyz-G6zllvL5-py3.8\lib\site-packages\comet_ml\connection.py", line 4720, in get_from_endpoint
    retval = super(RestApiClientWithCache, self).get_from_endpoint(
  File "C:\Users\User\AppData\Local\pypoetry\Cache\virtualenvs\projectxyz-G6zllvL5-py3.8\lib\site-packages\comet_ml\connection.py", line 2016, in get_from_endpoint
    response = self.get(url, params, timeout=timeout, stream=stream)
  File "C:\Users\User\AppData\Local\pypoetry\Cache\virtualenvs\projectxyz-G6zllvL5-py3.8\lib\site-packages\comet_ml\connection.py", line 2183, in get
    return super(RestApiClient, self).get(
  File "C:\Users\User\AppData\Local\pypoetry\Cache\virtualenvs\projectxyz-G6zllvL5-py3.8\lib\site-packages\comet_ml\connection.py", line 1999, in get
    raise CometRestApiException("GET", response)
comet_ml.exceptions.CometRestApiException: GET https://www.comet.com/api/rest/v2/registry-model failed with status code 400: Bad Request (Constraint-Violation)

Screenshots or GIFs

image

baniasbaabe commented 11 months ago

If I run the same code from Google Colab, it runs without errors

baniasbaabe commented 11 months ago

Closed, there were problems with my api key