使用 Colab 的 TensorFlow 依赖性问题
Issues with dependencies of TensorFlow using Colab
我正在尝试将批量集成模型与 Colab 结合使用。 pip 安装:
!pip install "git+https://github.com/google/uncertainty-baselines.git#egg=uncertainty_baselines"
并得到以下错误:
ERROR: tensorflow 2.5.0 has requirement keras-nightly~=2.5.0.dev, but you'll have keras-nightly 2.7.0.dev2021070800 which is incompatible.
ERROR: tf-nightly 2.7.0.dev20210708 has requirement grpcio<2.0,>=1.37.0, but you'll have grpcio 1.34.1 which is incompatible.
一旦我尝试使用导入来使用该库:
import uncertainty_baselines as ub
它引发了这个错误
ImportError: cannot import name '__version__' from 'keras' (/usr/local/lib/python3.7/dist-packages/keras/__init__.py)
所以我尝试手动修复包的版本,我尝试先安装以下包和依赖项:
!pip install keras-nightly==2.5.0.dev2021020510
!pip install grpcio==1.34.0
!pip install tensorflow==2.5.0
!pip install tf-nightly==2.7.0.dev20210708
但它引发了以下错误:
ERROR: tf-nightly 2.7.0.dev20210708 has requirement grpcio<2.0,>=1.37.0, but you'll have grpcio 1.34.1 which is incompatible.
ERROR: tf-nightly 2.7.0.dev20210708 has requirement keras-nightly~=2.7.0.dev, but you'll have keras-nightly 2.5.0.dev2021020510 which is incompatible
我再次尝试修复版本:
!pip install keras-nightly==2.7.0.dev2021070800
!pip install grpcio==1.37.0
!pip install tensorflow==2.5.0
!pip install tf-nightly==2.7.0.dev20210708
但现在它引发了以下错误:
ERROR: tensorflow 2.5.0 has requirement grpcio~=1.34.0, but you'll have grpcio 1.37.0 which is incompatible.
ERROR: tensorflow 2.5.0 has requirement keras-nightly~=2.5.0.dev, but you'll have keras-nightly 2.7.0.dev2021070800 which is incompatible.
这似乎是我无法解决的循环依赖关系,并且与张量有关,而不是与我尝试使用的特定存储库有关。
编辑:
此存储库的问题已通过删除 tf-nightly 依赖项(在新 MR 后删除)得到解决
问题已通过新 MR 解决 -
github.com/google/uncertainty-baselines/issues/407
删除了 tf-nightly 的依赖。
我正在尝试将批量集成模型与 Colab 结合使用。 pip 安装:
!pip install "git+https://github.com/google/uncertainty-baselines.git#egg=uncertainty_baselines"
并得到以下错误:
ERROR: tensorflow 2.5.0 has requirement keras-nightly~=2.5.0.dev, but you'll have keras-nightly 2.7.0.dev2021070800 which is incompatible.
ERROR: tf-nightly 2.7.0.dev20210708 has requirement grpcio<2.0,>=1.37.0, but you'll have grpcio 1.34.1 which is incompatible.
一旦我尝试使用导入来使用该库:
import uncertainty_baselines as ub
它引发了这个错误
ImportError: cannot import name '__version__' from 'keras' (/usr/local/lib/python3.7/dist-packages/keras/__init__.py)
所以我尝试手动修复包的版本,我尝试先安装以下包和依赖项:
!pip install keras-nightly==2.5.0.dev2021020510
!pip install grpcio==1.34.0
!pip install tensorflow==2.5.0
!pip install tf-nightly==2.7.0.dev20210708
但它引发了以下错误:
ERROR: tf-nightly 2.7.0.dev20210708 has requirement grpcio<2.0,>=1.37.0, but you'll have grpcio 1.34.1 which is incompatible.
ERROR: tf-nightly 2.7.0.dev20210708 has requirement keras-nightly~=2.7.0.dev, but you'll have keras-nightly 2.5.0.dev2021020510 which is incompatible
我再次尝试修复版本:
!pip install keras-nightly==2.7.0.dev2021070800
!pip install grpcio==1.37.0
!pip install tensorflow==2.5.0
!pip install tf-nightly==2.7.0.dev20210708
但现在它引发了以下错误:
ERROR: tensorflow 2.5.0 has requirement grpcio~=1.34.0, but you'll have grpcio 1.37.0 which is incompatible.
ERROR: tensorflow 2.5.0 has requirement keras-nightly~=2.5.0.dev, but you'll have keras-nightly 2.7.0.dev2021070800 which is incompatible.
这似乎是我无法解决的循环依赖关系,并且与张量有关,而不是与我尝试使用的特定存储库有关。
编辑:
此存储库的问题已通过删除 tf-nightly 依赖项(在新 MR 后删除)得到解决
问题已通过新 MR 解决 - github.com/google/uncertainty-baselines/issues/407
删除了 tf-nightly 的依赖。