简体   繁体   English

为什么我需要来自 tensorflow 的另一个 conda 环境?

[英]Why do I need another conda environment from tensorflow?

I'm currently trying to start working with tensorflow.我目前正在尝试开始使用 tensorflow。 I work with anaconda and I tried to install the tensorflow packages in the root environment but it always displays the message: "Several errors encountered".我使用 anaconda 并尝试在根环境中安装 tensorflow 包,但它始终显示消息:“遇到几个错误”。 When I looked it up it says the solution is to create another environment exclusively for tensorflow, I did and it worked.当我查看它时,它说解决方案是专门为 tensorflow 创建另一个环境,我做到了并且它奏效了。 But I'd still like to know what the reason for this is.但我还是想知道这是什么原因。

I have had the same question when I started out.我刚开始时也有同样的问题。 It seemed like it is the "correct" thing to do, so I just did it, but never understood why.这似乎是“正确”的事情,所以我就这样做了,但一直不明白为什么。 After working with TensorFlow for 2 years now, and on multiple machines, I realised just how specific the set of its requirements is.在使用 TensorFlow 2 年后,在多台机器上,我意识到它的需求集是多么的具体。 Only a few versions of python are compatible with it, the same thing with numpy , and if you want to use NVIDIA GPUs, good luck figuring out the specific versions of cuda and cudnn .只有少数版本的 python 与它兼容,与numpy相同,如果你想使用 NVIDIA GPU,祝你好运找出cudacudnn的特定版本。

You don't want to have to tailor most of the python-related software on your machine to running tensorflow.你不想在你的机器上定制大多数与 python 相关的软件来运行 tensorflow。 In order to avoid breaking it whenever you install something that requires a higher version of numpy , for example, it is best to keep it in a separate environment.例如,为了避免在安装需要更高版本numpy东西时破坏它,最好将其保存在单独的环境中。 This way you have an isolated "container" that keeps everything just the way TensorFlow wants it, while still being able to use other software if needed.这样你就有了一个独立的“容器”,它让一切都按照 TensorFlow 想要的方式保存,同时如果需要,仍然可以使用其他软件。 Not to mention that there are several versions of TensorFlow and they all have different requirements.更不用说TensorFlow有多个版本,它们都有不同的要求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我是否需要在 conda 基础环境中更新/升级 Python 版本? - Do I need to update/upgrade Python version at conda base environment? 如何将conda环境从一个python版本克隆到另一个? - How do I clone a conda environment from one python release to another? 从另一个 Conda 环境中的脚本中在 Conda 环境中运行脚本 - Running script in Conda environment from within script in another Conda environment 如何从 Docker 容器在指定的 conda 环境中启动? - How do I start in a specified conda environment from a Docker container? tensorflow不适用于conda环境 - tensorflow is not working on a conda environment 每个环境我需要另一个.condarc吗 - do I need another .condarc for each environment 我正在使用 conda 环境,如何从 conda 或 pip 导出包文件? - I'm using conda environment, how do I export the packages file, from conda or pip? 为什么我需要在 TensorFlow 中初始化变量? - Why do I need to initialize variables in TensorFlow? 如果我通过 conda 安装 tf,是否需要手动为 tensorflow-gpu 安装 CUDA 驱动程序 - Do I need to install CUDA driver for tensorflow-gpu manually if I install tf through conda 我是否需要将 OS 或 Math 等基本模块放入新的 conda 环境中? - Do I need to put basic modules like OS or Math into a new conda environment?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM