系统环境
1、ubuntu18.04
2、anaconda3/python3.7
3、RTX2080
4、cuda_10.0.130_410.48_linux.run
5、cudnn-10.0-linux-x64-v7.6.0
检查环境:
which pip
pip list
确定在anaconda3/python3.7/中
一、安装cosine_metric_learning
深度余弦度量学习
[cosine metric learning]
https://github.com/nwojke/cosine_metric_learning
1、安装tensorflow_gpu 1.15.0
pip install tensorflow_gpu==1.15.0 -i http://mirrors.aliyun.com/pypi/simple/
由于cosine_metric_learning的实际开发是基于tensorflow 1.x ,实际安装的tensorflow_gpu需为1.x版本,安装tensorflow_gpu1.15.0版本时,出现过2.0经过警告,并且cudnn的版本需为7.6.0版本
2、安装tensorboard 1.15.0
用于信息tensorflow可视化信息显示
tensorflow_gpu时会自动安装。
如果没自动安装可手动安装
pip install tensorboard==1.15.0
运行时如遇报错:
...
ValueError: Duplicate plugins for name projector
删掉:anaconda3/lib/python3.7/site-packages/tensorboard-1.15.0.dist-info
参考网址:
https://blog.csdn.net/Avada_533/article/details/102223823
3、安装numpy 1.18.0
pip install numpy==1.18.0 -i http://mirrors.aliyun.com/pypi/simple/
原本环境中的numpy版本时1.18.0,numpy版本需与tensorflow版本相对应
二、运行时
运行时会由于没有限制内存,需在queued_trainer.py 405行添加两行代码
config = tf.compat.v1.ConfigProto(gpu_options=tf.compat.v1.GPUOptions(allow_growth=True))
sess = tf.compat.v1.Session(config=config)
参考
https://blog.csdn.net/qq_44761397/article/details/107816110