mask-RCNN笔记——代码GPU使用
在这篇的开头,代码已经可以正常使用了,过程参考另一篇
https://blog.****.net/Diana_Z/article/details/83147636
GPU使用实验:
(这是一个使用实验,以及改错的过程)
环境:ubuntu16.04,python3.5,GPU4个
测试修改代码:train_shaoes.py
1、修改config文件
出现错误
定位之后发现错误位置在创建模型这一步
在判断GPU的时候,包导入时正确的
进入ParallelModel的构造函数,执行self.gpu_count=gpu_count的时候一切正常,并且成功生成了属性gpu_count
但是执行完成这一步之后,数据当中自动生成了一个叫做inner_model的变量,并且在将keras_model赋值给self.inner_model的时候无法成功赋值
解决方法:
加入了红框所示的一句话
2、安装TensorFlow-gpu
出现错误:libcublas.so.9.0:cannot open shared object file: No such file or directory
原因:
tensorlow的版本与cuda不一致导致的错误,查看文献后发现我使用的cuda8.0,cuDNN6.0,对应的tensorflow版本是1.3.0或者1.4.0
3、出现问题: softmax() got an unexpected keyword argument 'axis'
【1】
4、问题:reduce_mean() got an unexpected keyword argument 'keepdims'
解决:【2】
系统函数中reduce_mean()中的参数名称是keep_dims
只要把model.py文件中的出错的keepdims修改成系统函数中的名字keep_dims就可以了。
参考资料:
【1】https://blog.****.net/w5688414/article/details/80145894
【2】https://blog.****.net/qq_36362060/article/details/80888949