tensorflow :AttributeError: 'module' object has no attribute 'computation'

本文提供TensorFlow GPU版的安装步骤及官方文档链接,并分享了一个关于Dask版本导致AttributeError的具体问题及解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  官方安装文档:https://www.tensorflow.org/install/install_linux#installing_with_anaconda

        gpu 版的下载地址:https://pypi.python.org/pypi/tensorflow-gpu

  安装命令:(python2.7版)

  pip install --ignore-installed --upgrade tensorflow_gpu-1.2.1-cp27-cp27mu-manylinux1_x86_64.whl 

  安装gpu版成功的话,在运行程序会有显示显卡信息,以及可用的显存。

  文档很详细。我是安装完Anaconda后,安装的TF,跑hello word 没发现问题。后面具体跑代码,出现:AttributeError: 'module' object has no attribute 'computation'。后面查了下,有人说是dask版本的问题,原来我的是0.13,更新到0.15就没问题了。(conda list)

  conda update dask 

问题可见:

https://stackoverflow.com/questions/43833081/attributeerror-module-object-has-no-attribute-computation

2025-06-23 14:58:05.426819: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. 2025-06-23 14:58:06.523258: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. [14:58:07] 程序启动 2025-06-23 14:58:07.945195: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: SSE3 SSE4.1 SSE4.2 AVX AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. Traceback (most recent call last): File "E:\pycharm\study\object\face_model.py", line 366, in <module> main() File "E:\pycharm\study\object\face_model.py", line 316, in main recognizer = DormFaceRecognizer( File "E:\pycharm\study\object\face_model.py", line 118, in __init__ self.embedder = load_facenet_manually(cache_dir=facenet_cache_dir) File "E:\pycharm\study\object\face_model.py", line 52, in load_facenet_manually socket.setdefaulttimeout(60) # 60秒超时 AttributeError: type object 'socket' has no attribute 'setdefaulttimeout' 正在初始化FaceNet... 发现已缓存的模型文件: ./facenet_cache\facenet_weights.h5 文件大小可能不完整(87.92MB),将重新下载... 正在下载FaceNet模型文件(约95MB)...
最新发布
06-24
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值