简体   繁体   English

无法安装低于 2.0 的 Tensorflow

[英]Can't install Tensorflow lower than 2.0

I got this error我收到这个错误

AttributeError: module 'TensorFlow' has no attribute 'variable_scope' AttributeError:模块“TensorFlow”没有属性“variable_scope”

when I ran my code and I'm searching in Google for this.当我运行我的代码时,我在谷歌中搜索这个。 They said it required TensorFlow lower than 2.0.他们说它要求 TensorFlow 低于 2.0。 Then I started to install it with this code in cmd pip install tensorflow==1.15 then I got another error然后我开始用这个代码安装它 cmd pip install tensorflow==1.15然后我又得到了一个错误

ERROR: Could not find a version that satisfies the requirement tensorflow==1.15 (from versions: 2.5.0rc0, 2.5.0rc1, 2.5.0rc2, 2.5.0rc3, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0rc0, 2.6.0rc1, 2.6.0rc2, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.7.0rc0, 2.7.0rc1, 2.7.0, 2.7.1, 2.8.0rc0, 2.8.0rc1, 2.8.0) ERROR: No matching distribution found for tensorflow==1.15错误:找不到满足 tensorflow==1.15 要求的版本(来自版本:2.5.0rc0、2.5.0rc1、2.5.0rc2、2.5.0rc3、2.5.0、2.5.1、2.5.2、2.5.3 , 2.6.0rc0, 2.6.0rc1, 2.6.0rc2, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.7.0rc0, 2.7.0rc1, 2.7.0, 2.7.1, 2.8.0rc0, 2.8 .0rc1, 2.8.0) 错误:找不到与 tensorflow==1.15 匹配的分布

I tried a lot of ways on the inte.net to find a way to solve it!在inter.net上试了很多方法才找到解决的办法! My information Tensorflow and computer我的信息Tensorflow和电脑

Name: tensorflow Version: 2.8.0 Summary: TensorFlow is an open source machine learning framework for everyone.名称:tensorflow 版本:2.8.0 摘要:TensorFlow是一个开源的机器学习框架,供大家使用。 Home-page: https://www.tensorflow.org/ Author: Google Inc. Author-email: packages@tensorflow.org License: Apache 2.0 Location: c:\users\admin\appdata\roaming\python\python39\site-packages Requires: absl-py, astunparse, flatbuffers, gast, google-pasta, grpcio, h5py, keras, keras-preprocessing, libclang, numpy, opt-einsum, protobuf, setuptools, six, tensorboard, tensorflow-io-gcs-filesystem, termcolor, tf-estimator-nightly, typing-extensions, wrapt主页: https://www.tensorflow.org/作者:Google Inc. 作者邮箱:packages@tensorflow.org 许可证:Apache 2.0 位置:c:\users\admin\appdata\roaming\python\python39\site -packages Requires: absl-py, astunparse, flatbuffers, gast, google-pasta, grpcio, h5py, keras, keras-preprocessing, libclang, numpy, opt-einsum, protobuf, setuptools, six, tensorboard, tensorflow-io-gcs-文件系统、termcolor、tf-estimator-nightly、打字扩展、wrapt

Python 3.9.7 Python 3.9.7

Computer information:计算机信息:

Intel(R) Core(TM) i7-8750H CPU Processor @ 2.20 GHz 2.21 GHz Installed RAM 16.0 GB (15.9 GB usable) Device ID 26A28871-033A-43F4-9933-B82BE00E75C3 Product ID 00330-80000-00000-AA214 System type 64 bit Operating system, processor based on x64 Pen and apps No pen or touchpad for this monitor Intel(R) Core(TM) i7-8750H CPU 处理器 @ 2.20 GHz 2.21 GHz 安装 RAM 16.0 GB(可用 15.9 GB) 设备 ID 26A28871-033A-43F4-9933-B82BE00E75C3 产品 ID 00330-80000-00000-AA214 系统类型 64 bit 操作系统,基于 x64 笔和应用程序的处理器 此显示器没有笔或触摸板

Thank you for your help谢谢您的帮助

You probably have CUDA11 install on your system.您的系统上可能安装了 CUDA11。 Tensorflow 1.X can't run on CUDA 11 unless you use Docker and Nvidia Container Toolkit. Tensorflow 1.X 无法在 CUDA 11 上运行,除非您使用 Docker 和 Nvidia Container Toolkit。

I recommend you to use a Docker container provided by Tensorflow with the required version.我建议您使用 Tensorflow 提供的具有所需版本的 Docker 容器。

tensorflow/tensorflow:1.14.0-gpu-py3

Check this post to view information about Python, CUDA, CudNN and Tensorflow version requirements:查看此帖子以查看有关 Python、CUDA、CudNN 和 Tensorflow 版本要求的信息:

Which TensorFlow and CUDA version combinations are compatible? 哪些 TensorFlow 和 CUDA 版本组合兼容?

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM