Clarifai / clarifai-javascript

Official Clarifai JavaScript client for browsers and node.js
https://docs.clarifai.com
Other
351 stars 81 forks source link

corrected version ids #38

Closed jvandy83 closed 5 years ago

jvandy83 commented 5 years ago

I was unable to use the current version id's listed on GitHub when passed along with the model type as arguments in the function templated within the docs on your website. Of course I could easily execute the function without passing a version number but it was confusing at first when I was trying to adhere strictly to the templated syntax in the docs. So I'm not sure if this is needed but I plucked out and re-pasted the model version ids that work when passed as arguments along with model type.

rok-povsic commented 5 years ago

Hi @jvandy83,

In your PR, the hard-coded model IDs are replaced with model version IDs. This is not correct since there is a difference between a model ID and a model version ID. They are in a one-to-many relationship. In other words, a model has one or several model versions.

For example, the General Model was first created in 2016, and an with its creation, an initial model version was made. A couple years later, another, improved, model version was published - but the model ID of the General model stays the same.

The JS client (and more general, the Clarifai API), allows you to specify a model and, optionally, a model version when doing requests - this allows you to use, say, the older General model version, if you so desire.

We don't hard-code model version IDs in the code since they are subject to change. When omitting a model version ID when doing say, a predict request, the latest model version will automatically be used.

Without your specific code how you're using the client, I can't tell what exactly you're doing incorrectly, but feel free to reply. Thanks.

jvandy83 commented 5 years ago

Hello! Thanks so much for your response! I’m just building a simple face recognition application. Just following a tutorial, actually. I’m a novice. Using JS, we are only displaying faces and creating the box outline around the face. When attempting to fetch the Clarifai API, I initially was trying to pass the model ID listed in the Git Hub ‘src’ file as an argument unsuccessfully.

Your explanation makes total sense. I thought I stumbled across something that may have been overlooked by you guys but you’re are obviously on top of it, there!

I will continue to tinker with this and hopefully figure out how to train my app to recognize the images that I’m using.

On Fri, Aug 9, 2019 at 7:09 AM rok-povsic notifications@github.com wrote:

Hi @jvandy83 https://github.com/jvandy83,

In your PR, the hard-coded model IDs are replaced with model version IDs. This is not correct since there is a difference between a model ID and a model version ID. They are in a one-to-many relationship. In other words, a model has one or several model versions.

For example, the General Model was first created in 2016, and an with its creation, an initial model version was made. A couple years later, another, improved, model version was published - but the model ID of the General model stays the same.

The JS client (and more general, the Clarifai API), allows you to specify a model and, optionally, a model version when doing requests - this allows you to use, say, the older General model version, if you so desire.

We don't hard-code model version IDs in the code since they are subject to change. When omitting a model version ID when doing say, a predict request, the latest model version will automatically be used.

Without your specific code how you're using the client, I can't tell what exactly you're doing incorrectly, but feel free to reply. Thanks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Clarifai/clarifai-javascript/pull/38?email_source=notifications&email_token=ALQJFUQBN3VZRORLBCM5VD3QDVT73A5CNFSM4IIWUE62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD36T2ZQ#issuecomment-519912806, or mute the thread https://github.com/notifications/unsubscribe-auth/ALQJFUSODYOIKNSVRSWTCK3QDVT73ANCNFSM4IIWUE6Q .