How to deploy a model trained with a custom package on Google ML Engine?Manage scikit-learn model in Google Cloud PlatformCan't train my Tensorflow detector model in Google CloudGcloud ml-engine: FAILED_PRECONDITION: Field: package_uris ErrorGoogle Machine Learning Engine Python 3Get the path of saved_model.pb after training on ML engineError creating model version using “gcloud ml-engine versions create”Google Cloud ML returns empty predictions with object detection modelTPOT model in google ml-engineGoogle Cloud Platform, Ml Engine, No module named sklearn_crfsuite.estimatorWhy does google ml-engine online predict return a different prediction from local predict?

Strange LED behavior: Why is there a voltage over the LED with only one wire connected to it?

German phrase for 'suited and booted'

What kind of anatomy does a centaur have?

Killing a star safely

Has Peter Parker ever eaten bugs?

Why can't a country print its own money to spend it only abroad?

Why did modems have speakers?

Why is DC so, so, so Democratic?

Xcode 10.3 Installation

Why does the salt in the oceans not sink to the bottom?

How can I show that the speed of light in vacuum is the same in all reference frames?

Do you have to hide in order for other creatures to not know your location inside a fog cloud?

What is "It is x o'clock" in Japanese with subject

Are gangsters hired to attack people at a train station classified as a terrorist attack?

Can I make an Opportunity Attack during Time Stop?

Is there a way to shorten this while condition?

Short story where a flexible reality hardens to an unchanging one

Arduino Bluetooth communication is slowing down because of the 'for' loop!

Impact of throwing away fruit waste on a peak > 3200 m above a glacier

Why is the UH-60 tail rotor canted?

How can I calculate the cost of Skyss bus tickets

Can we have too many dialogue tags and follow up actions?

Giving blur shadow to plot

Is it better to merge "often" or only after completion do a big merge of feature branches?



How to deploy a model trained with a custom package on Google ML Engine?


Manage scikit-learn model in Google Cloud PlatformCan't train my Tensorflow detector model in Google CloudGcloud ml-engine: FAILED_PRECONDITION: Field: package_uris ErrorGoogle Machine Learning Engine Python 3Get the path of saved_model.pb after training on ML engineError creating model version using “gcloud ml-engine versions create”Google Cloud ML returns empty predictions with object detection modelTPOT model in google ml-engineGoogle Cloud Platform, Ml Engine, No module named sklearn_crfsuite.estimatorWhy does google ml-engine online predict return a different prediction from local predict?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I'm able to train a scikit-learn model that includes custom functions on Google ML Engine with a call like this:



gcloud ml-engine jobs submit training "module_name" 
--job-dir gs://my_bucket/scikit_learn_job_dir
--package-path ./my_package/
--module-name my_package.trainer.train
--region us-east1
--runtime-version='1.12'
--python-version='3.5'
--scale-tier BASIC


This code trains the model and uploads a pickle file, model.pkl to gs://my_bucket/models.



However, I get an error when trying to deploy with :



gcloud ml-engine versions create "version_name" 
--model model_name
--origin gs://my_bucket/models
--runtime-version='1.12'
--framework "SCIKIT_LEARN"
--python-version='3.5'


The error says that my_package cannot be loaded. Indeed, I can't find any option equivalent to --package-path in the version create command documentation.










share|improve this question






















  • So the job is submitted/queued in ML Engine right? It would be super helpful if you could post your error logs from jobs in ML Engine.

    – Pramesh Bajracharya
    Mar 26 at 13:53











  • Hello! The job is submitted in ML Engine and works fine. The model.pkl file is created and uploaded to GCS. The problem is when I create a model version from this .pkl file. The version has a red dot instead of a blue check mark and in the version details, the error is "Create Version failed. Bad model detected with error: "Failed to load model: Could not load the model: /tmp/model/0001/model.pkl. No module named 'my_package'. (Error code: 0)". This was expected, because I didn't send my_package with the version create call, but I didn't find how to!

    – Ajr
    Apr 2 at 2:12

















1















I'm able to train a scikit-learn model that includes custom functions on Google ML Engine with a call like this:



gcloud ml-engine jobs submit training "module_name" 
--job-dir gs://my_bucket/scikit_learn_job_dir
--package-path ./my_package/
--module-name my_package.trainer.train
--region us-east1
--runtime-version='1.12'
--python-version='3.5'
--scale-tier BASIC


This code trains the model and uploads a pickle file, model.pkl to gs://my_bucket/models.



However, I get an error when trying to deploy with :



gcloud ml-engine versions create "version_name" 
--model model_name
--origin gs://my_bucket/models
--runtime-version='1.12'
--framework "SCIKIT_LEARN"
--python-version='3.5'


The error says that my_package cannot be loaded. Indeed, I can't find any option equivalent to --package-path in the version create command documentation.










share|improve this question






















  • So the job is submitted/queued in ML Engine right? It would be super helpful if you could post your error logs from jobs in ML Engine.

    – Pramesh Bajracharya
    Mar 26 at 13:53











  • Hello! The job is submitted in ML Engine and works fine. The model.pkl file is created and uploaded to GCS. The problem is when I create a model version from this .pkl file. The version has a red dot instead of a blue check mark and in the version details, the error is "Create Version failed. Bad model detected with error: "Failed to load model: Could not load the model: /tmp/model/0001/model.pkl. No module named 'my_package'. (Error code: 0)". This was expected, because I didn't send my_package with the version create call, but I didn't find how to!

    – Ajr
    Apr 2 at 2:12













1












1








1








I'm able to train a scikit-learn model that includes custom functions on Google ML Engine with a call like this:



gcloud ml-engine jobs submit training "module_name" 
--job-dir gs://my_bucket/scikit_learn_job_dir
--package-path ./my_package/
--module-name my_package.trainer.train
--region us-east1
--runtime-version='1.12'
--python-version='3.5'
--scale-tier BASIC


This code trains the model and uploads a pickle file, model.pkl to gs://my_bucket/models.



However, I get an error when trying to deploy with :



gcloud ml-engine versions create "version_name" 
--model model_name
--origin gs://my_bucket/models
--runtime-version='1.12'
--framework "SCIKIT_LEARN"
--python-version='3.5'


The error says that my_package cannot be loaded. Indeed, I can't find any option equivalent to --package-path in the version create command documentation.










share|improve this question














I'm able to train a scikit-learn model that includes custom functions on Google ML Engine with a call like this:



gcloud ml-engine jobs submit training "module_name" 
--job-dir gs://my_bucket/scikit_learn_job_dir
--package-path ./my_package/
--module-name my_package.trainer.train
--region us-east1
--runtime-version='1.12'
--python-version='3.5'
--scale-tier BASIC


This code trains the model and uploads a pickle file, model.pkl to gs://my_bucket/models.



However, I get an error when trying to deploy with :



gcloud ml-engine versions create "version_name" 
--model model_name
--origin gs://my_bucket/models
--runtime-version='1.12'
--framework "SCIKIT_LEARN"
--python-version='3.5'


The error says that my_package cannot be loaded. Indeed, I can't find any option equivalent to --package-path in the version create command documentation.







python scikit-learn google-cloud-ml






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 26 at 13:42









AjrAjr

1615 bronze badges




1615 bronze badges












  • So the job is submitted/queued in ML Engine right? It would be super helpful if you could post your error logs from jobs in ML Engine.

    – Pramesh Bajracharya
    Mar 26 at 13:53











  • Hello! The job is submitted in ML Engine and works fine. The model.pkl file is created and uploaded to GCS. The problem is when I create a model version from this .pkl file. The version has a red dot instead of a blue check mark and in the version details, the error is "Create Version failed. Bad model detected with error: "Failed to load model: Could not load the model: /tmp/model/0001/model.pkl. No module named 'my_package'. (Error code: 0)". This was expected, because I didn't send my_package with the version create call, but I didn't find how to!

    – Ajr
    Apr 2 at 2:12

















  • So the job is submitted/queued in ML Engine right? It would be super helpful if you could post your error logs from jobs in ML Engine.

    – Pramesh Bajracharya
    Mar 26 at 13:53











  • Hello! The job is submitted in ML Engine and works fine. The model.pkl file is created and uploaded to GCS. The problem is when I create a model version from this .pkl file. The version has a red dot instead of a blue check mark and in the version details, the error is "Create Version failed. Bad model detected with error: "Failed to load model: Could not load the model: /tmp/model/0001/model.pkl. No module named 'my_package'. (Error code: 0)". This was expected, because I didn't send my_package with the version create call, but I didn't find how to!

    – Ajr
    Apr 2 at 2:12
















So the job is submitted/queued in ML Engine right? It would be super helpful if you could post your error logs from jobs in ML Engine.

– Pramesh Bajracharya
Mar 26 at 13:53





So the job is submitted/queued in ML Engine right? It would be super helpful if you could post your error logs from jobs in ML Engine.

– Pramesh Bajracharya
Mar 26 at 13:53













Hello! The job is submitted in ML Engine and works fine. The model.pkl file is created and uploaded to GCS. The problem is when I create a model version from this .pkl file. The version has a red dot instead of a blue check mark and in the version details, the error is "Create Version failed. Bad model detected with error: "Failed to load model: Could not load the model: /tmp/model/0001/model.pkl. No module named 'my_package'. (Error code: 0)". This was expected, because I didn't send my_package with the version create call, but I didn't find how to!

– Ajr
Apr 2 at 2:12





Hello! The job is submitted in ML Engine and works fine. The model.pkl file is created and uploaded to GCS. The problem is when I create a model version from this .pkl file. The version has a red dot instead of a blue check mark and in the version details, the error is "Create Version failed. Bad model detected with error: "Failed to load model: Could not load the model: /tmp/model/0001/model.pkl. No module named 'my_package'. (Error code: 0)". This was expected, because I didn't send my_package with the version create call, but I didn't find how to!

– Ajr
Apr 2 at 2:12












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55358634%2fhow-to-deploy-a-model-trained-with-a-custom-package-on-google-ml-engine%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55358634%2fhow-to-deploy-a-model-trained-with-a-custom-package-on-google-ml-engine%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript