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











up vote
4
down vote

favorite












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
    Nov 19 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 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
    Nov 19 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 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
    Nov 19 at 17:15















up vote
4
down vote

favorite












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
    Nov 19 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 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
    Nov 19 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 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
    Nov 19 at 17:15













up vote
4
down vote

favorite









up vote
4
down vote

favorite











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 2 days ago









Maxim

3556




3556










asked Nov 19 at 15:50









Grant Hosticka

165318




165318








  • 1




    Are you running this command from the cloudml-samples-master/census/estimator directory?
    – Dustin
    Nov 19 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 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
    Nov 19 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 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
    Nov 19 at 17:15














  • 1




    Are you running this command from the cloudml-samples-master/census/estimator directory?
    – Dustin
    Nov 19 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 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
    Nov 19 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 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
    Nov 19 at 17:15








1




1




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




Are you running this command from the cloudml-samples-master/census/estimator directory?
– Dustin
Nov 19 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 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 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
Nov 19 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
Nov 19 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 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 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
Nov 19 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
Nov 19 at 17:15












1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










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',
    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








    up vote
    0
    down vote



    accepted










    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

























      up vote
      0
      down vote



      accepted










      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























        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        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 at 17:33









        Grant Hosticka

        165318




        165318






























             

            draft saved


            draft discarded



















































             


            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

            404 Error Contact Form 7 ajax form submitting

            How to know if a Active Directory user can login interactively

            TypeError: fit_transform() missing 1 required positional argument: 'X'