
深度学习环境
小鹏酱
这个作者很懒,什么都没留下…
展开
-
AttributeError: module ‘tensorflow‘ has no attribute ‘placeholder‘
今天把代码放到新服务器上跑,结果报错:“AttributeError: module ‘tensorflow’ has no attribute ‘placeholder’” 原因是:之前代码用tf1.8,新服务器环境是tf2.5,而且代码中调用了tf1中的API,因此会报错,解决方法: 原来代码: import tensorflow as tf 改过之后的代码: import tensorflow.compat.v1 as tf tf.disable_v2_behavior() 问题得到解决。 ..原创 2020-12-05 20:44:41 · 19652 阅读 · 8 评论 -
3090 cuda 11安装tensorflow-gpu2.5.0
3090目前好像只支持11.0往上的cuda版本,因此我装的tensorflow-gpu为2.5.0版本,使用阿里源下载,命令行如下: pip install tf-nightly-gpu==2.5.0 -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com 安装完成后,进入Python环境,验证是否安装成功: 代码如下: import tensorflow as tf print(tf.test.is_gpu原创 2020-12-05 20:13:33 · 9619 阅读 · 8 评论