找回密码
 立即注册
查看: 180|回复: 0

graphsage-tensorflow 安装

[复制链接]
发表于 2023-4-4 20:08 | 显示全部楼层 |阅读模式
打开Anaconda Prompt
创建虚拟环境
conda create -n envcc python=3.10激活环境
activate env-name 打开安装好的pycharm
新建一个项目,环境选择刚刚配置好的虚拟环境,至此anaconda配置的虚拟环境就链接到pycharm中了。
(在原有项目里,如果需要用到配置的虚拟环境,则修改一下python编译器即可,选择配置的虚拟环境编译器)
创建TensorFlow环境
conda create -n tensorflow python激活
activate tensorflow使用豆瓣镜像
pip install -i https://pypi.douban.com/simple/ tensorflow之前好多博客说清华镜像,我不知道是什么原因一直安装失败,这个还挺快,能下载
另:
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/

测试是否安装成功
python
import tensorflow as tf测不出来啊无语,用:




错误描述:
dlerror: cudart64_110.dll not found
解决方法
cudart64_110.dll free download | DLL‑files.com下载


解压会出现如下文件:cudart64_110.dll


把cudart64_110.dll复制粘贴到:
在64位版本的Windows中,32位DLL文件的默认文件夹是C:\Windows\SysWOW64\,64位DLL文件是C:\Windows\System32\。

指定 Python 的相应版本来下载:
conda create --name tensorflow python=3.5不可以,python3.9.16 对应的2.6.0
pip install tensorflow==2.6 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

报错:TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
解决方案:
输入
pip uninstall protobuf将现有版本的卸载,
然后输入
pip install protobuf 3.19.0
pip install protobuf==3.19.0


由于网速会影响成功率,我运行了两次才装成功的。

出错
ERROR: Cannot unpack file C:\Users\Lenovo\AppData\Local\Temp\pip-unpack-bph4anlw\simple.html (downloaded from C:\Users\Lenovo\AppData\Local\Temp\pip-req-build-pbmos7b8, content-type: text/html); cannot detect archive format
ERROR: Cannot determine archive format of C:\Users\Lenovo\AppData\Local\Temp\pip-req-build-pbmos7b8
解决方法:换源 但无果
反复:pip install protobuf==3.19.0



好像行了

报错:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
tensorboard 2.12.0 requires protobuf>=3.19.6, but you have protobuf 3.19.0 which is incompatible.
解决:安装3.19.6版本
pip install protobuf==3.19.6


成了

没成:

conda create -n tf18 python==3.6
GPU版
用activate env 打不开虚拟环境:使用conda activate env就能打开了
再:
pip install tensorflow-gpu==1.8.0总之在安装了,不知道情况怎么样


不行,再次报错:
protobuf requires Python '>=3.7' but the running Python is 3.6.0
You are using pip version 9.0.1, however version 23.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
解决方法:先更新pip,即
python -m pip install --upgrade pip做完这一步再重新安装TensorFlow
可以了



退出虚拟环境:
conda deactivate删除虚拟环境:

conda remove -n your_env_name --allkeras镜像安装代码如下:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ --upgrade keras==2.3.1卸载环境
conda uninstall -n env-name --all

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Unity开发者联盟 ( 粤ICP备20003399号 )

GMT+8, 2024-5-14 19:22 , Processed in 0.119037 second(s), 28 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表