【问题标题】:Changing the Google Cloud Deep Learning VM image version after deployment?部署后更改 Google Cloud Deep Learning VM 映像版本?
【发布时间】:2020-03-26 07:31:57
【问题描述】:

我使用标准 tensorflow-gpu==1.15 映像在 Google Cloud 上部署了深度学习虚拟机。但是,后来我意识到我需要tensorflow-gpu>=1.4。由于我已经对我的 VM 实例进行了大量处理,我想知道是否可以升级映像版本而无需部署新的 VM?

谢谢!

【问题讨论】:

  • 您好,只是澄清一下。您想降级到 1.4 版吗? 1.15 版本已经大于 1.4,所以 tensorflow-gpu>=1.4 已经成立。
  • 您好,我认为您将 tensorflow 1.15 与 tensorflow-1.5 混淆了?
  • 嗯 here 是 TF 版本...看不出我会如何混淆版本。 1.15 版似乎比 1.4 版或 1.5 版更新。如果我错了,请纠正我。
  • 对不起@milia。我想我混淆了版本。但是,我认为我需要特定的 tf-1.4 版本。我正在尝试使用 tensorflow-nmt API github.com/tensorflow/nmt
  • 您好。没关系。我设法使用 REAME.md 中提供的示例命令,从 TF 版本为 1.15 的 TF 实例训练了一个 NMT 模型(具有 128 维隐藏单元和嵌入 12 个时期的 2 层 LSTM seq2seq 模型)。但如果您坚持需要 1.4 版,我可以进一步研究如何(以及是否)可以降级。

标签: google-cloud-platform deep-learning virtual-machine google-dl-platform


【解决方案1】:

我假设当您说“是否可以升级映像版本而无需部署新 VM?”。你的意思是降级。

是的,可以在深度学习 VM 中降级 Tensorflow 的版本

我已经运行了以下测试,看看是否可行。

1) 按照Creating a Deep Learning VM Instance From the Google Cloud Marketplace 安装深度学习虚拟机

SSH 进入虚拟机后

2) 在交互式 python shell 中检查安装的版本

>>> import tensorflow as tf
 2020-03-30 11:57:03.076701: I 
 tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully 
 opened dynamic library libcudart.so.10.1
 2020-03-30 11:57:07.162626: I 
 tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully 
 opened dynamic library libnvinfer.so.6
 2020-03-30 11:57:07.222695: I 
 tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully 
 opened dynamic library libnvinfer_plugin.so.6
 >>> print(tf.__version__)
 2.1.0

下一步是运行;

pip install --upgrade tensorflow==1.14.0

命令成功,但出现以下错误;

ERROR: scikit-image 0.15.0 requires pillow>=4.3.0, which is not installed.
ERROR: imageio 2.6.1 requires pillow, which is not installed.
ERROR: tensorflow-serving-api-gpu 1.14.0 has requirement tensorflow-gpu~=1.14.0, but you'll have tensorflow-gpu 2.1.0 which is incompatible.
ERROR: tensorflow-gpu 2.1.0 has requirement numpy<2.0,>=1.16.0, but you'll have numpy 1.15.4 which is incompatible.
ERROR: tensorflow-gpu 2.1.0 has requirement scipy==1.4.1; python_version >= "3", but you'll have scipy 1.1.0 which is incompatible.
ERROR: tensorflow-io 0.9.10 has requirement tensorflow==2.1.0rc0, but you'll have tensorflow 1.4.0 which is incompatible.

如您所见,这会导致依赖性问题。

接下来的步骤是;

a) pip install --upgrade  pillow==4.3.0
b) pip install --upgrade tensorflow-gpu==1.14.0

在交互式 python shell 中再次检查版本

Python 3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.


>>> import tensorflow as tf

   /home/xxxxxxxxx/.local/lib/python3.5/site- 
   packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing 
   (type, 1) or '1type' as a synonym of type is deprecated; in a future version 
   of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   _np_qint8 = np.dtype([("qint8", np.int8, 1)])
   /home/xxxxxxxx/.local/lib/python3.5/site- 
   packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing 
   (type, 1) or '1type' as a synonym of type is deprecated; in a future version 
   of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
   /home/xxxxxxxx/.local/lib/python3.5/site- 
   packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing 
   (type, 1) or '1type' as a synonym of type is deprecated; in a future version 
   of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   _np_qint16 = np.dtype([("qint16", np.int16, 1)])
   /home/xxxxxxx/.local/lib/python3.5/site- 
   packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing 
   (type, 1) or '1type' as a synonym of type is deprecated; in a future version 
   of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
   /home/xxxxxxx/.local/lib/python3.5/site- 
   packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing 
   (type, 1) or '1type' as a synonym of type is deprecated; in a future version 
   of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   _np_qint32 = np.dtype([("qint32", np.int32, 1)])
   /home/xxxxxxxx/.local/lib/python3.5/site- 
   packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing 
   (type, 1) or '1type' as a synonym of type is deprecated; in a future version 
   of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   np_resource = np.dtype([("resource", np.ubyte, 1)])
   /home/xxxxxxxx/.local/lib/python3.5/site- 
   packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: 
   Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future 
   version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   _np_qint8 = np.dtype([("qint8", np.int8, 1)])
   /home/xxxxxxx/.local/lib/python3.5/site- 
   packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: 
   Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future 
   version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
   /home/xxxxxxxx/.local/lib/python3.5/site- 
   packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: 
   Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future 
   version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   _np_qint16 = np.dtype([("qint16", np.int16, 1)])
   /home/xxxxxxxx/.local/lib/python3.5/site- 
   packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: 
   Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future 
   version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
   /home/xxxxxxx/.local/lib/python3.5/site- 
   packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: 
   Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future 
   version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   _np_qint32 = np.dtype([("qint32", np.int32, 1)])
   /home/xxxxxxxx/.local/lib/python3.5/site- 
   packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: 
   Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future 
   version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   np_resource = np.dtype([("resource", np.ubyte, 1)])
   >>> print(tf.__version__)
   1.14.0

运行“pip freeze”命令检查依赖关系; 在更改版本之前 pip freeze 输出;

"....tensorboard==2.1.0
tensorflow-datasets==1.3.0
tensorflow-estimator==2.1.0
tensorflow-gpu==2.1.0
tensorflow-hub==0.7.0
tensorflow-io==0.9.10
tensorflow-metadata==0.21.1
tensorflow-probability==0.9.0
tensorflow-serving-api-gpu==1.14.0......."

更改版本后 pip freeze 输出;

"....
tensorboard==1.14.0
tensorflow==1.14.0
tensorflow-datasets==1.3.0
tensorflow-estimator==1.14.0
tensorflow-gpu==1.14.0
tensorflow-hub==0.7.0
tensorflow-io==0.9.10
tensorflow-metadata==0.21.1
tensorflow-probability==0.9.0
tensorflow-serving-api-gpu==1.14.0
tensorflow-tensorboard==0.4.0...."

【讨论】:

  • 非常感谢!
猜你喜欢
  • 1970-01-01
  • 2021-12-22
  • 1970-01-01
  • 2020-09-11
  • 2018-11-12
  • 1970-01-01
  • 2021-10-11
  • 2023-03-12
  • 1970-01-01
相关资源
最近更新 更多