簡體   English   中英

Tensorflow:docker鏡像和-gpu后綴

[英]Tensorflow: docker image and -gpu suffix

In the Docker image for Tensorflow with GPU support (for example: tensorflow/tensorflow:2.2.0-gpu ) the installed python package is tensorflow-gpu (as shown in pip freeze ).

Installing any python package that depends on tensorflow triggers the installation of tensorflow itself, although it's already installed under a different name (because -- correctly -- tensorflow-gpu != tensorflow ).

有沒有辦法避免這種情況?

您可以添加一條指令以安裝僅寫入元數據而不添加重復源的假tensorflow “包”:

$ python -c 'from setuptools import setup; setup(name="tensorflow", version="2.2.0")' install

在 docker 圖像中,這將如下所示:

FROM tensorflow/tensorflow:2.2.0-gpu
RUN python -c 'from setuptools import setup; setup(name="tensorflow", version="2.2.0")' install
RUN pip install my-requirements
RUN pip uninstall -y tensorflow  # cleaning up

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM