Git Product home page Git Product logo

Comments (6)

zdhernandez avatar zdhernandez commented on June 20, 2024 2

@dizcology That works!

It printed:
"Long running operation..."
export_model_response: done

and I have a bucket with one model.tflite file

The export_model_sample should include the "export_format_id" as well as the example from GCP.

Thank you very much for your time and help.

from python-aiplatform.

dizcology avatar dizcology commented on June 20, 2024

Hello @zdhernandez: Thank you for reporting the issue. The service defaults to the first supported export formats if it is not specified in the request: https://github.com/googleapis/python-aiplatform/blob/master/google/cloud/aiplatform_v1beta1/types/model_service.py#L220-L225

So it appears that the model you have does not support any export format. Only certain model types support model export: tabular and edge according to the documentation.

from python-aiplatform.

zdhernandez avatar zdhernandez commented on June 20, 2024

@dizcology The model that I am trying to export is of type: MOBILE_TF_LOW_LATENCY_1
Did I forget to pass an extra argument?

update: I double-checked the AIPlatform and I can confirm it is an edge model.
When I go under the "Model Properties" tab I can see:

  • Algorithm: AutoML Edge
  • Objective: Image classification (Single-label)

from python-aiplatform.

dizcology avatar dizcology commented on June 20, 2024

Thank you @zdhernandez, for good measure could you try again with a modified request like this: https://github.com/googleapis/python-aiplatform/blob/master/samples/snippets/export_model_video_action_recognition_sample.py#L34-L37

(Looking at the sample test, it seems you might need to format the string in a certain particular way.)

from python-aiplatform.

zdhernandez avatar zdhernandez commented on June 20, 2024

@dizcology I tried:

output_config = { "artifact_destination": "gs://my-bucket-vcm/model-123123123123/tflite/2021-01-28T16:00:00.000Z/", "export_format_id": "tflite", }

and got:

Traceback (most recent call last):
  File "/app/main.py", line 676, in <module>
    response = aiplatform_model_client.export_model(name=name, output_config=output_config)
  File "/usr/local/lib/python3.8/site-packages/google/cloud/aiplatform_v1beta1/services/model_service/client.py", line 924, in export_model
    request.output_config = output_config
  File "/usr/local/lib/python3.8/site-packages/proto/message.py", line 584, in __setattr__
    pb_value = marshal.to_proto(pb_type, value)
  File "/usr/local/lib/python3.8/site-packages/proto/marshal/marshal.py", line 205, in to_proto
    pb_value = rule.to_proto(value)
  File "/usr/local/lib/python3.8/site-packages/proto/marshal/rules/message.py", line 32, in to_proto
    return self._descriptor(**value)
TypeError: Parameter to MergeFrom() must be instance of same class: expected google.cloud.aiplatform.v1beta1.GcsDestination got str.

from python-aiplatform.

dizcology avatar dizcology commented on June 20, 2024

I think the value of artifact_destination needs to be a Python dict or a protobuf message. Please try something like the following:

output_config = {
    "artifact_destination": {"output_uri_prefix": "gs://..."},
    "export_format_id": "tflite",
}

from python-aiplatform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.