【问题标题】:Pip install of tensorflowjs not working due to apparent version conflict with tensorflow由于明显的版本与 tensorflow 冲突,tensorflowjs 的 Pip 安装无法正常工作
【发布时间】:2021-05-24 18:00:31
【问题描述】:

我目前在 conda 虚拟环境中尝试 pip install tensorflowjs,但每次我这样做时都会卡住试图找到与 tensorflowjs 兼容的 tensorflow 或 Numpy 版本,并最终在此过程中死掉。我的命令:

pip 安装 tensorflowjs

我想使用 tensorflowjs 进行转换,所以如果有更好的方法,我不喜欢在 python 中进行转换。但除此之外,安装 tensorflowjs 的最佳方法是什么。

似乎也没有办法通过 conda 安装来做到这一点,因为 conda-forge 中似乎不存在该软件包。

【问题讨论】:

  • 尝试卸载当前有冲突的TensorFlow版本
  • 目前没有安装。我创建了一个全新的虚拟环境来安装 tensorflowjs。我已仔细检查以确保。
  • 我现在意识到这可能是由于我使用了当前与 tensorflow 不兼容的 python 3.9。降级到 python 3.8 已经解决了这个问题。

标签: python tensorflow pip


【解决方案1】:

降级到 python 3.8 解决了这个问题。截至 2021 年 2 月 22 日,tensorflow 与 python 3.9 不兼容。

【讨论】:

    【解决方案2】:

    我在 Python 3.6 环境中安装了最新版本的tensorflowjs 并检查了依赖关系:

    tensorflowjs 3.1.0 Python Libraries and Tools for TensorFlow.js
    ├── h5py >=2.8.0,<3
    ├── six >=1.12.0,<2
    ├── tensorflow >=2.1.0,<3
    └── tensorflow-hub >=0.7.0,<0.10
    

    tensorflow 本身是tensorflowjs 的依赖项。那么你使用的是哪个版本的tensorflowjs

    【讨论】:

    • 我刚刚安装了最新版本的 tensorflowjs,所以版本为 3.1.0。但经过一番挖掘后,我意识到问题出在尝试在 python 3.9 的环境中安装 tensorflow,但没有意识到它在那里不起作用。
    猜你喜欢
    • 1970-01-01
    • 2014-04-13
    • 2019-07-27
    • 2018-03-08
    • 2019-10-19
    • 1970-01-01
    • 1970-01-01
    • 2022-10-25
    相关资源
    最近更新 更多