我正在尝试将谷歌云用于机器学习课程 我按照此页面中的说明操作: https://github.com/google/eng-edu/blob/master/ml/cc/README.md
(在Google Cloud上运行Datalab一节)
我到达了第5步,我必须将端口更改为8081
我按照说明操作,得到以下错误:
错误:无法连接到端口8081上的Cloud Shell
确保您的服务器正在侦听端口8081并再试一次
你能告诉我如何解决这个问题吗?
(我在windows 10和chrome工作)
谢谢,
伊兰
以下是我通过激活命令(而不是shell)激活的datalab_create.sh的结果 我激活了3个命令:
gcloud services启用compute_component
gcloud服务启用ml.googleapis.com
./eng-edu/ml/cc/bin/datalab_connect.sh
Welcome to Cloud Shell! Type "help" to get started.
hindy_ilan@windy-hangar-200805:~$ gcloud services enable compute_component
Waiting for async operation operations/tmo-acf.a926e02c-e264-4ec1-b136-094a9efa6916 to complete...
Operation finished successfully. The following command can describe the Operation details:
gcloud services operations describe operations/tmo-acf.a926e02c-e264-4ec1-b136-094a9efa6916
hindy_ilan@windy-hangar-200805:~$
hindy_ilan@windy-hangar-200805:~$ gcloud services operations describe operations/tmo-acf.a926e02c-e264-4ec1-b136-094a9efa6916
done: true
metadata:
'@type': type.googleapis.com/google.api.servicemanagement.v1.OperationMetadata
resourceNames:
- services/compute_component/projectSettings/921211249673
name: operations/tmo-acf.a926e02c-e264-4ec1-b136-094a9efa6916
response:
'@type': type.googleapis.com/google.api.servicemanagement.v1.EnableServiceResponse
hindy_ilan@windy-hangar-200805:~$ gcloud services enable ml.googleapis.com
Waiting for async operation operations/tmo-acf.e8aa5fe8-fbf5-4011-b730-461255f15805 to complete...
Operation finished successfully. The following command can describe the Operation details:
gcloud services operations describe operations/tmo-acf.e8aa5fe8-fbf5-4011-b730-461255f15805
hindy_ilan@windy-hangar-200805:~$ gcloud services operations describe operations/tmo-acf.e8aa5fe8-fbf5-4011-b730-461255f15805
done: true
metadata:
'@type': type.googleapis.com/google.api.servicemanagement.v1.OperationMetadata
resourceNames:
- services/ml.googleapis.com/projectSettings/921211249673
name: operations/tmo-acf.e8aa5fe8-fbf5-4011-b730-461255f15805
response:
'@type': type.googleapis.com/google.api.servicemanagement.v1.EnableServiceResponse
hindy_ilan@windy-hangar-200805:~$ ./eng-edu/ml/cc/bin/datalab_connect.sh
Checking Datalab VM mlccvm-hindyilan exists
ERROR: Datalab VM does not exist
hindy_ilan@windy-hangar-200805:~$
答案 0 :(得分:0)
This github问题(由此comment中指示的OP引发)包含一个指向实际错误(ERROR: (gcloud) Invalid choice: 'service-management'
)的日志文件。这里的问题是使用datalab_create.sh
脚本,更具体地说是使用以下两行来启用Google Compute Engine和Cloud Machine Learning API:
gcloud service-management enable compute_component
gcloud service-management enable ml.googleapis.com
脚本已过时:service-management enable
命令已replaced by services enable
。当我试图重现你的问题时,我收到一条警告信息,表明这一点。我的猜测是你没有得到那条消息,因为你使用的是与我不同的Cloud SDK版本。使用最新版本(截至4月17日的197.0.0)运行会抛出这些警告,但仍启用API。您可以通过运行gcloud version
来检查已启用的版本,并通过运行gcloud components update
更新到最新版本。
第二种选择是将这两行替换为:
gcloud services enable compute_component
gcloud services enable ml.googleapis.com
答案 1 :(得分:0)
以下是我发现的:
datalab_create.sh是:
let item = MPMediaItem()
let sortName = item.value(forProperty: "someMagicSortNamePropertyIdentifier") as! String
脚本的前两个命令是错误的,所以我更换了它们(根据你的建议用命令:
hindy_ilan@windy-hangar-200805:~$ more ./eng-edu/ml/cc/bin/datalab_create.sh
#!/bin/bash
#
# A script to create a new Datalab VM.
#
# author: psimakov@google.com (Pavel Simakov)
set -e
. "$(dirname "$0")/common.sh"
prompt_user_for_confirmation "Google Compute Engine and Cloud Machine Learning APIs will be enabled and new Datalab VM will be created."
echo "Enabling Google Compute Engine and Cloud Machine Learning APIs"
gcloud service-management enable compute_component
gcloud service-management enable ml.googleapis.com
assert_datalab_vm_does_not_exist
ensure_components
echo "Provisioning a new Datalab VM"
datalab create "${MLCC_INSTANCE}" --zone="us-central1-a" --no-connect
echo "Success!"
我尝试激活的脚本中有第三个命令,结果是失败的结果:
gcloud services enable compute_component
gcloud services enable ml.googleapis.com
你知道怎么操作这种方法吗? 伊兰
答案 2 :(得分:0)
成功! 我更正了datalab_create.sh(根据您的推荐)并运行它 需要启用API然后再次运行脚本 之后它运作正常 谢谢, 伊兰