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

Model registration is not working #3699

Open
Aslyamovt opened this issue Mar 27, 2023 · 1 comment
Open

Model registration is not working #3699

Aslyamovt opened this issue Mar 27, 2023 · 1 comment
Assignees

Comments

@Aslyamovt
Copy link

I always get this kind of exception when i'm trying to call client.get_or_create_registered_model or client.get_registered_model

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Input In [27], in <cell line: 1>()
----> 1 client.get_registered_model("iris_classifier")

File D:\Anaconda\envs\agriculture\lib\site-packages\verta\client.py:899, in Client.get_registered_model(self, name, workspace, id)
    897     registered_model = RegisteredModel._get_by_id(self._conn, self._conf, id)
    898 else:
--> 899     registered_model = RegisteredModel._get_by_name(
    900         self._conn, self._conf, name, workspace
    901     )
    903 if registered_model is None:
    904     raise ValueError("Registered model not found")

File D:\Anaconda\envs\agriculture\lib\site-packages\verta\tracking\entities\_entity.py:141, in _ModelDBEntity._get_by_name(cls, conn, conf, name, parent)
    139 @classmethod
    140 def _get_by_name(cls, conn, conf, name, parent):
--> 141     msg = cls._get_proto_by_name(conn, name, parent)
    142     if msg:
    143         # pylint: disable=no-value-for-parameter
    144         # this is only called on subclasses, so 3 params to cls() is correct
    145         return cls(conn, conf, msg)

File D:\Anaconda\envs\agriculture\lib\site-packages\verta\registry\entities\_model.py:1003, in RegisteredModel._get_proto_by_name(cls, conn, name, workspace)
    996 Message = _RegistryService.GetRegisteredModelRequest
    997 response = conn.make_proto_request(
    998     "GET",
    999     "/api/v1/registry/workspaces/{}/registered_models/{}".format(
   1000         workspace, name
   1001     ),
   1002 )
-> 1003 return conn.maybe_proto_response(response, Message.Response).registered_model

File D:\Anaconda\envs\agriculture\lib\site-packages\verta\_internal_utils\_utils.py:222, in Connection.maybe_proto_response(response, response_type)
    219 @staticmethod
    220 def maybe_proto_response(response, response_type):
    221     if response.ok:
--> 222         response_msg = json_to_proto(body_to_json(response), response_type)
    223         return response_msg
    224     else:

File D:\Anaconda\envs\agriculture\lib\site-packages\verta\_internal_utils\_utils.py:590, in body_to_json(response)
    581 msg = "\n".join(
    582     [
    583         "expected JSON response from {}, but instead got:".format(response.url),
   (...)
    587     ]
    588 )
    589 msg = six.ensure_str(msg)
--> 590 six.raise_from(ValueError(msg), None)

File <string>:3, in raise_from(value, from_value)

ValueError: expected JSON response from http://localhost:3000/api/v1/registry/workspaces/personal/registered_models/iris_classifier, but instead got:
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.png"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="/manifest.json"/><title>Verta AI</title><link href="/static/css/2.722a1fc9.chunk.css" rel="stylesheet"><link href="/static/css/main.3a7bd0dc.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,l,a=r[0],f=r[1],i=r[2],c=0,s=[];c<a.length;c++)l=a[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in f)Object.prototype.hasOwnProperty.call(f,n)&&(e[n]=f[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,i||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var f=t[a];0!==o[f]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var a=this.webpackJsonpverta=this.webpackJsonpverta||[],f=a.push.bind(a);a.push=r,a=a.slice();for(var i=0;i<a.length;i++)r(a[i]);var p=f;t()}([])</script><script src="/static/js/2.2beaca20.chunk.js"></script><script src="/static/js/main.a839b027.chunk.js"></script></body></html>

Please notify the Verta development team.

I also get exception during client.create_registered_model

---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
Input In [28], in <cell line: 1>()
----> 1 client.create_registered_model(
      2     name="iris_classifier", 
      3     labels=["MLP", "pytorch", "classifier"]
      4 )

File D:\Anaconda\envs\agriculture\lib\site-packages\verta\client.py:1302, in Client.create_registered_model(self, name, desc, labels, workspace, public_within_org, visibility, task_type, data_type)
   1299 ctx = _Context(self._conn, self._conf)
   1300 ctx.workspace_name = workspace
-> 1302 return RegisteredModel._create(
   1303     self._conn,
   1304     self._conf,
   1305     ctx,
   1306     name=name,
   1307     desc=desc,
   1308     tags=labels,
   1309     public_within_org=public_within_org,
   1310     visibility=visibility,
   1311     task_type=task_type,
   1312     data_type=data_type,
   1313 )

File D:\Anaconda\envs\agriculture\lib\site-packages\verta\tracking\entities\_entity.py:179, in _ModelDBEntity._create(cls, conn, conf, *args, **kwargs)
    174 if "visibility" in kwargs and kwargs["visibility"] is None:
    175     # this case shouldn't happen since `visibility` should be wherever
    176     # `public_within_org` is, but just in case
    177     kwargs[VISIBILITY_KEY] = _workspace_default._WorkspaceDefault()
--> 179 msg = cls._create_proto(conn, *args, **kwargs)
    180 if msg:
    181     # pylint: disable=no-value-for-parameter
    182     # this is only called on subclasses, so 3 params to cls() is correct
    183     return cls(conn, conf, msg)

File D:\Anaconda\envs\agriculture\lib\site-packages\verta\tracking\entities\_entity.py:207, in _ModelDBEntity._create_proto(cls, conn, *args, **kwargs)
    197             attrs[key] = value._as_dict()
    199     kwargs["attrs"] = [
    200         _CommonCommonService.KeyValue(
    201             key=key,
   (...)
    204         for key, value in six.viewitems(attrs)
    205     ]
--> 207 return cls._create_proto_internal(conn, *args, **kwargs)

File D:\Anaconda\envs\agriculture\lib\site-packages\verta\registry\entities\_model.py:1050, in RegisteredModel._create_proto_internal(cls, conn, ctx, name, desc, tags, attrs, date_created, public_within_org, visibility, task_type, data_type)
   1041 msg.resource_visibility = visibility._visibility
   1043 response = conn.make_proto_request(
   1044     "POST",
   1045     "/api/v1/registry/workspaces/{}/registered_models".format(
   (...)
   1048     body=msg,
   1049 )
-> 1050 registered_model = conn.must_proto_response(
   1051     response, _RegistryService.SetRegisteredModel.Response
   1052 ).registered_model
   1054 if ctx.workspace_name is not None:
   1055     WORKSPACE_PRINT_MSG = "workspace: {}".format(ctx.workspace_name)

File D:\Anaconda\envs\agriculture\lib\site-packages\verta\_internal_utils\_utils.py:242, in Connection.must_proto_response(response, response_type)
    240     return response_msg
    241 else:
--> 242     raise_for_http_error(response)

File D:\Anaconda\envs\agriculture\lib\site-packages\verta\_internal_utils\_utils.py:555, in raise_for_http_error(response)
    552     cause = "Unexpected"
    553 message = f"{response.status_code} {cause} Error: {reason} " \
    554           f"for url: {response.url}{time_str}"
--> 555 six.raise_from(requests.HTTPError(message, response=response), None)

File <string>:3, in raise_from(value, from_value)

HTTPError: 404 Client Error: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /api/v1/registry/workspaces/personal/registered_models</pre>
</body>
</html> for url: http://localhost:3000/api/v1/registry/workspaces/personal/registered_models at 2023-03-27 12:13:10.908000 UTC
@liuverta
Copy link
Contributor

Hi @Aslyamovt, thank you for your interest in ModelDB! The Verta model catalog (which includes client functions like get_or_create_registered_model()) is currently only available through our hosted and enterprise offerings.

Depending on your use case, I'd recommend contacting us through our support page (https://www.verta.ai/contact-us) and folks there may be able to walk you through some potential options that can fit what you're looking for.

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