No module named trainer, Cloud ML Engine for TensorFlow Tutorial, Running Locally
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
add a comment |
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
1
Are you running this command from thecloudml-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 atrainer
directory that is local to where you are executing thegcloud
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
add a comment |
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
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
python tensorflow google-cloud-platform google-cloud-ml
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 thecloudml-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 atrainer
directory that is local to where you are executing thegcloud
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
add a comment |
1
Are you running this command from thecloudml-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 atrainer
directory that is local to where you are executing thegcloud
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
add a comment |
1 Answer
1
active
oldest
votes
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
add a comment |
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
add a comment |
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
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
answered Nov 19 '18 at 17:33
Grant Hosticka
165318
165318
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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 thegcloud
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