No module named trainer, Cloud ML Engine for TensorFlow Tutorial, Running Locally












4














Tutorial I am following



Have been attempting to follow the Google tutorial to use ML Engine for TensorFlow. Have gotten stuck where it says "run a local training job" with the error



/usr/bin/python: No module named trainer


Full command is:



gcloud ml-engine local train 
--module-name trainer.task
--package-path trainer/
--job-dir $MODEL_DIR
--
--train-files $TRAIN_DATA
--eval-files $EVAL_DATA
--train-steps 1000
--eval-steps 100


The three variables are all set up correctly to my knowledge though it doesn't even get to them right now. The tutorial doesn't specify downloading a trainer file or how it is referenced, googling for the past hour hasn't turned up any working solutions. Have found this general explanation:




--module-name specifies the name of your application's main module,
using your package's namespace dot notation. This is the Python file
that you run to start your application. For example, if your main
module is .../my_application/trainer/task.py (see the recommended
project structure), then the module name is trainer.task




Any info would be appreciated.










share|improve this question




















  • 1




    Are you running this command from the cloudml-samples-master/census/estimator directory?
    – Dustin Ingram
    Nov 19 '18 at 16:44










  • I am running it on my computer from directory that includes the data and output folders. The tutorial seemed to specify downloading and running from the estimator directory in the cloud shell only, but perhaps I am misunderstanding.
    – Grant Hosticka
    Nov 19 '18 at 16:57






  • 1




    You might have missed the "Download the code for this tutorial" step. You should have a trainer directory that is local to where you are executing the gcloud command.
    – Dustin Ingram
    Nov 19 '18 at 17:05










  • That is the step I thought was only supposed to happen in the cloud shell but will try it locally as well, thanks.
    – Grant Hosticka
    Nov 19 '18 at 17:11






  • 1




    It's not entirely clear, but the tutorial is assuming you're either doing this locally on your machine, or in Cloud Shell, not a mix of the two.
    – Dustin Ingram
    Nov 19 '18 at 17:15
















4














Tutorial I am following



Have been attempting to follow the Google tutorial to use ML Engine for TensorFlow. Have gotten stuck where it says "run a local training job" with the error



/usr/bin/python: No module named trainer


Full command is:



gcloud ml-engine local train 
--module-name trainer.task
--package-path trainer/
--job-dir $MODEL_DIR
--
--train-files $TRAIN_DATA
--eval-files $EVAL_DATA
--train-steps 1000
--eval-steps 100


The three variables are all set up correctly to my knowledge though it doesn't even get to them right now. The tutorial doesn't specify downloading a trainer file or how it is referenced, googling for the past hour hasn't turned up any working solutions. Have found this general explanation:




--module-name specifies the name of your application's main module,
using your package's namespace dot notation. This is the Python file
that you run to start your application. For example, if your main
module is .../my_application/trainer/task.py (see the recommended
project structure), then the module name is trainer.task




Any info would be appreciated.










share|improve this question




















  • 1




    Are you running this command from the cloudml-samples-master/census/estimator directory?
    – Dustin Ingram
    Nov 19 '18 at 16:44










  • I am running it on my computer from directory that includes the data and output folders. The tutorial seemed to specify downloading and running from the estimator directory in the cloud shell only, but perhaps I am misunderstanding.
    – Grant Hosticka
    Nov 19 '18 at 16:57






  • 1




    You might have missed the "Download the code for this tutorial" step. You should have a trainer directory that is local to where you are executing the gcloud command.
    – Dustin Ingram
    Nov 19 '18 at 17:05










  • That is the step I thought was only supposed to happen in the cloud shell but will try it locally as well, thanks.
    – Grant Hosticka
    Nov 19 '18 at 17:11






  • 1




    It's not entirely clear, but the tutorial is assuming you're either doing this locally on your machine, or in Cloud Shell, not a mix of the two.
    – Dustin Ingram
    Nov 19 '18 at 17:15














4












4








4







Tutorial I am following



Have been attempting to follow the Google tutorial to use ML Engine for TensorFlow. Have gotten stuck where it says "run a local training job" with the error



/usr/bin/python: No module named trainer


Full command is:



gcloud ml-engine local train 
--module-name trainer.task
--package-path trainer/
--job-dir $MODEL_DIR
--
--train-files $TRAIN_DATA
--eval-files $EVAL_DATA
--train-steps 1000
--eval-steps 100


The three variables are all set up correctly to my knowledge though it doesn't even get to them right now. The tutorial doesn't specify downloading a trainer file or how it is referenced, googling for the past hour hasn't turned up any working solutions. Have found this general explanation:




--module-name specifies the name of your application's main module,
using your package's namespace dot notation. This is the Python file
that you run to start your application. For example, if your main
module is .../my_application/trainer/task.py (see the recommended
project structure), then the module name is trainer.task




Any info would be appreciated.










share|improve this question















Tutorial I am following



Have been attempting to follow the Google tutorial to use ML Engine for TensorFlow. Have gotten stuck where it says "run a local training job" with the error



/usr/bin/python: No module named trainer


Full command is:



gcloud ml-engine local train 
--module-name trainer.task
--package-path trainer/
--job-dir $MODEL_DIR
--
--train-files $TRAIN_DATA
--eval-files $EVAL_DATA
--train-steps 1000
--eval-steps 100


The three variables are all set up correctly to my knowledge though it doesn't even get to them right now. The tutorial doesn't specify downloading a trainer file or how it is referenced, googling for the past hour hasn't turned up any working solutions. Have found this general explanation:




--module-name specifies the name of your application's main module,
using your package's namespace dot notation. This is the Python file
that you run to start your application. For example, if your main
module is .../my_application/trainer/task.py (see the recommended
project structure), then the module name is trainer.task




Any info would be appreciated.







python tensorflow google-cloud-platform google-cloud-ml






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 25 '18 at 8:15









Maxim

1,507210




1,507210










asked Nov 19 '18 at 15:50









Grant Hosticka

165318




165318








  • 1




    Are you running this command from the cloudml-samples-master/census/estimator directory?
    – Dustin Ingram
    Nov 19 '18 at 16:44










  • I am running it on my computer from directory that includes the data and output folders. The tutorial seemed to specify downloading and running from the estimator directory in the cloud shell only, but perhaps I am misunderstanding.
    – Grant Hosticka
    Nov 19 '18 at 16:57






  • 1




    You might have missed the "Download the code for this tutorial" step. You should have a trainer directory that is local to where you are executing the gcloud command.
    – Dustin Ingram
    Nov 19 '18 at 17:05










  • That is the step I thought was only supposed to happen in the cloud shell but will try it locally as well, thanks.
    – Grant Hosticka
    Nov 19 '18 at 17:11






  • 1




    It's not entirely clear, but the tutorial is assuming you're either doing this locally on your machine, or in Cloud Shell, not a mix of the two.
    – Dustin Ingram
    Nov 19 '18 at 17:15














  • 1




    Are you running this command from the cloudml-samples-master/census/estimator directory?
    – Dustin Ingram
    Nov 19 '18 at 16:44










  • I am running it on my computer from directory that includes the data and output folders. The tutorial seemed to specify downloading and running from the estimator directory in the cloud shell only, but perhaps I am misunderstanding.
    – Grant Hosticka
    Nov 19 '18 at 16:57






  • 1




    You might have missed the "Download the code for this tutorial" step. You should have a trainer directory that is local to where you are executing the gcloud command.
    – Dustin Ingram
    Nov 19 '18 at 17:05










  • That is the step I thought was only supposed to happen in the cloud shell but will try it locally as well, thanks.
    – Grant Hosticka
    Nov 19 '18 at 17:11






  • 1




    It's not entirely clear, but the tutorial is assuming you're either doing this locally on your machine, or in Cloud Shell, not a mix of the two.
    – Dustin Ingram
    Nov 19 '18 at 17:15








1




1




Are you running this command from the cloudml-samples-master/census/estimator directory?
– Dustin Ingram
Nov 19 '18 at 16:44




Are you running this command from the cloudml-samples-master/census/estimator directory?
– Dustin Ingram
Nov 19 '18 at 16:44












I am running it on my computer from directory that includes the data and output folders. The tutorial seemed to specify downloading and running from the estimator directory in the cloud shell only, but perhaps I am misunderstanding.
– Grant Hosticka
Nov 19 '18 at 16:57




I am running it on my computer from directory that includes the data and output folders. The tutorial seemed to specify downloading and running from the estimator directory in the cloud shell only, but perhaps I am misunderstanding.
– Grant Hosticka
Nov 19 '18 at 16:57




1




1




You might have missed the "Download the code for this tutorial" step. You should have a trainer directory that is local to where you are executing the gcloud command.
– Dustin Ingram
Nov 19 '18 at 17:05




You might have missed the "Download the code for this tutorial" step. You should have a trainer directory that is local to where you are executing the gcloud command.
– Dustin Ingram
Nov 19 '18 at 17:05












That is the step I thought was only supposed to happen in the cloud shell but will try it locally as well, thanks.
– Grant Hosticka
Nov 19 '18 at 17:11




That is the step I thought was only supposed to happen in the cloud shell but will try it locally as well, thanks.
– Grant Hosticka
Nov 19 '18 at 17:11




1




1




It's not entirely clear, but the tutorial is assuming you're either doing this locally on your machine, or in Cloud Shell, not a mix of the two.
– Dustin Ingram
Nov 19 '18 at 17:15




It's not entirely clear, but the tutorial is assuming you're either doing this locally on your machine, or in Cloud Shell, not a mix of the two.
– Dustin Ingram
Nov 19 '18 at 17:15












1 Answer
1






active

oldest

votes


















0














Thanks to the information from Dustin in the comments have found the solution.



Was simply downloading the trainer directory on the Cloud Shell and not my local environment.



Now File Structure Looks Like:



estimator
|-- data
| |-- adult_data.csv
| |-- adult_test.csv
|-- output
|-- trainer
| |-- __init__.py
| |-- model.py
| |-- task.ipynb
| |-- task.py





share|improve this answer





















    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%2f53378242%2fno-module-named-trainer-cloud-ml-engine-for-tensorflow-tutorial-running-locall%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Thanks to the information from Dustin in the comments have found the solution.



    Was simply downloading the trainer directory on the Cloud Shell and not my local environment.



    Now File Structure Looks Like:



    estimator
    |-- data
    | |-- adult_data.csv
    | |-- adult_test.csv
    |-- output
    |-- trainer
    | |-- __init__.py
    | |-- model.py
    | |-- task.ipynb
    | |-- task.py





    share|improve this answer


























      0














      Thanks to the information from Dustin in the comments have found the solution.



      Was simply downloading the trainer directory on the Cloud Shell and not my local environment.



      Now File Structure Looks Like:



      estimator
      |-- data
      | |-- adult_data.csv
      | |-- adult_test.csv
      |-- output
      |-- trainer
      | |-- __init__.py
      | |-- model.py
      | |-- task.ipynb
      | |-- task.py





      share|improve this answer
























        0












        0








        0






        Thanks to the information from Dustin in the comments have found the solution.



        Was simply downloading the trainer directory on the Cloud Shell and not my local environment.



        Now File Structure Looks Like:



        estimator
        |-- data
        | |-- adult_data.csv
        | |-- adult_test.csv
        |-- output
        |-- trainer
        | |-- __init__.py
        | |-- model.py
        | |-- task.ipynb
        | |-- task.py





        share|improve this answer












        Thanks to the information from Dustin in the comments have found the solution.



        Was simply downloading the trainer directory on the Cloud Shell and not my local environment.



        Now File Structure Looks Like:



        estimator
        |-- data
        | |-- adult_data.csv
        | |-- adult_test.csv
        |-- output
        |-- trainer
        | |-- __init__.py
        | |-- model.py
        | |-- task.ipynb
        | |-- task.py






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 19 '18 at 17:33









        Grant Hosticka

        165318




        165318






























            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.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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%2f53378242%2fno-module-named-trainer-cloud-ml-engine-for-tensorflow-tutorial-running-locall%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

            Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

            Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

            A Topological Invariant for $pi_3(U(n))$