Python 在 GCP 上被杀死 [英] Python killed on GCP

查看:64
本文介绍了Python 在 GCP 上被杀死的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直致力于比较以在本地机器和 Google Cloud Platform 上运行深度学习代码.代码是关于循环神经网络的,它在本地机器上运行得非常好.但是在GCP cloud shell上,当我想编译我的python文件时,它显示Killed"

I have been working on comparison to run deep learning code on local machine and Google Cloud Platform. The code is about recurrent neural network and it ran perfectly well on local machine. But on GCP cloud shell, when I want to compile my python file, it shows "Killed"

userID@projectID:~$ python rnn.py

被杀

是不是因为我内存不足?(因为我尝试逐行运行,第二次将大数据分配给变量时,它卡住了.)我的代码有点像这样

Is it because that I am out of memory? (because I tried to run line by line, and on the second time I assigned large data to a variable, it stuck.) My code is somewhat like this

imdb = np.load('imdb_word_emb.npz')X_train = imdb['X_train']X_test = imdb['X_test']

在第三行,机器卡住并显示Killed"

on the third line, the machine stuck and showed "Killed"

我试图改变第二行和第三行的顺序,它仍然卡在第三行.我的训练数据是一个 (25000,80,128) 数组.我的测试数据也是如此.该数据集在我的本地机器上运行良好.我确定这个数据集没有问题.

I tried to change the order of the second and third line, it still stuck at the third line. My training data is a (25000,80,128)-array. So is my testing data. The data set works perfectly well on my local machine. I am sure there are no problem with this data set.

还是因为其他原因?如果知道如何解决甚至很少有关键词的人告诉我如何处理这个,那就太棒了.谢谢:D

Or is it because of other reasons? It would be awesome if people who know how to solve or even few key words tell me how to deal with this. Thank you :D

推荐答案

您得到的错误是因为 Cloud Shell 不适用于计算或网络密集型进程,请参阅 Cloud Shell 限制.

The error you are getting is because Cloud Shell is not intended for computational or network intensive processes, see Cloud Shell limitations.

我了解您想将本地计算机与 Google Cloud Platform 进行比较.如在公共文档中所述:

I understand you want to compare your local machine with Google Cloud Platform. As stated in the public docs:

"当您启动 Cloud Shell 时,它会预配一个 g1-small Google Compute引擎"

"When you start Cloud Shell, it provisions a g1-small Google Compute Engine"

g1-small 机器类型具有 1.70GB RAM 和共享的物理内核.记住这一点,而且如前所述,这是一个限制,您的本地机器可能比 Cloud Shell 更强大,因此您看不到任何改进.

A g1-small machine type has 1.70GB RAM and a shared physical core. Keeping this in mind and also that is a limited as stated before, your local machine is likely more powerful than Cloud Shell so you'd not see any improvement.

我建议您使用不同的机器类型创建一个 Compute Engine 实例,您可以使用自定义机器类型来设置您想要拥有的内核数和 GB 内存.我猜您想从在 Google Compute Engine 中更快地运行您的工作负载中受益,这样您就可以在资源方面选择比本地机器类型更好的机器类型,并比较它的改进程度.

I recommend you to create a Compute Engine instance with a different machine type, you can use a custom machine type to set the number of cores and GB of RAM you want to have. I guess you want to benefit from running your workload faster in Google Compute Engine so you can choose a better machine type than your local one in terms of resources and compare how much it improves.

这篇关于Python 在 GCP 上被杀死的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆