哪种Google云端平台服务最容易运行Tensorflow? [英] Which Google Cloud Platform service is the easiest for running Tensorflow?
问题描述
- 是否有任何现成的解决方案可以在GCP上运行Tensorflow?
- 如果不是,哪个服务(计算引擎或容器引擎)会让开始更容易?
- / LI>
醇>
解决方案总结的答案:
在计算引擎上运行TensorFlow的逐步说明:
gcloud计算实例创建tf \
--image container-vm \
--zone europe-west1-c \\ \\
--machine-type n1-standard-2
- 运行
sudo docker run -d -p 8888:8888 --name tf b.gcr.io/tensorflow-udacity/assignments:0.5.0
(将图像名称更改为所需图像名称) - 在 dashboard 并编辑
default
network。 - 添加防火墙规则以允许您的IP以及协议和端口
tcp:8888
。 - 从仪表板找到实例的外部IP。在浏览器上打开
IP:8888
。完成! - 完成后,请删除创建的群集以避免收费。 我是如何做到的,它的工作原理。我相信有一个更简单的方法来做到这一点。
更多资源
您可能有兴趣了解更多关于:
- Google云端Shell
- 容器优化的Google Compute Engine图片
- Google Cloud SDK ,以获得更响应的外壳和更多内容。
相关提示
- 即使在虚拟机终止并重新启动之后,您的云端Shell主目录的内容仍然保留在所有云端Shell会话之间的项目之间
- 列出所有可用的图像版本:
gcloud compute images list --project google-containers
感谢@ user728291,@MattW。和@CJCullen。
While working on Udacity Deep Learning assignments, I encountered memory problem. I need to switch to a cloud platform. I worked with AWS EC2 before but now I would like to try Google Cloud Platform (GCP). I will need at least 8GB memory. I know how to use docker locally but never tried it on the cloud.
- Is there any ready-made solution for running Tensorflow on GCP?
- If not, which service (Compute Engine or Container Engine) would make it easier to get started?
- Any other tip is also appreciated!
解决方案Summing up the answers:
Step by step instructions to run TensorFlow on Compute Engine:
- Create a project
- Open the Cloud Shell (a button at the top)
- List machine types:
gcloud compute machine-types list
. You can change the machine type I used in the next command. - Create an instance:
gcloud compute instances create tf \ --image container-vm \ --zone europe-west1-c \ --machine-type n1-standard-2
- Run
sudo docker run -d -p 8888:8888 --name tf b.gcr.io/tensorflow-udacity/assignments:0.5.0
(change the image name to the desired one) - Find your instance in the dashboard and edit
default
network. - Add a firewall rule to allow your IP as well as protocol and port
tcp:8888
. - Find the External IP of the instance from the dashboard. Open
IP:8888
on your browser. Done! - When you are finished, delete the created cluster to avoid charges.
This is how I did it and it worked. I am sure there is an easier way to do it.
More Resources
You might be interested to learn more about:
- Google Cloud Shell
- Container-Optimized Google Compute Engine Images
- Google Cloud SDK for a more responsive shell and more.
Good to know
- "The contents of your Cloud Shell home directory persist across projects between all Cloud Shell sessions, even after the virtual machine terminates and is restarted"
- To list all available image versions:
gcloud compute images list --project google-containers
Thanks to @user728291, @MattW. and @CJCullen.
这篇关于哪种Google云端平台服务最容易运行Tensorflow?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- 运行