之前tensorflow的检测环境一直没有用gpu版的
后来在python3.6+cuda8.0+cudnn6下装tensorflow1.2/1.3/1.4都有问题报错
①:1.2、1.3的gpu版在import tensorflow时就直接报错
②:1.4的TensorFlow-gpu可以import,但是在运行faster的时候就有问题
tensorflow下载:https://mirrors.tuna.tsinghua.edu.cn/tensorflow/windows/gpu/
解决修改:
python3.5(Anaconda4.2.0)+cuda8.0+cudnn6+tensorflow1.3.0-rc0
但还是报错:传入参数类型问题
net = block.unit_fn(net, rate=1, **unit)
TypeError: bottleneck() argument after ** must be a mapping, not tuple
TypeError: bottleneck() argument after ** must be a mapping, not tuple
解决方法,修改代码(faster-rcnn/lib/nets/resnet_v1.py)
我用的是resnet101,所以修改了build_network的这一段
blocks = [
resnet_v1.resnet_v1_block('block1', base_depth=64, num_units=3, stride=2),
resnet_v1.resnet_v1_block('block2', base_depth=128, num_units=4, stride=2),
resnet_v1.resnet_v1_block('block3', base_depth=256, num_units=23, stride=1),
resnet_v1.resnet_v1_block('block4', base_depth=512, num_units=3, stride=1),
]
resnet_v1.resnet_v1_block('block1', base_depth=64, num_units=3, stride=2),
resnet_v1.resnet_v1_block('block2', base_depth=128, num_units=4, stride=2),
resnet_v1.resnet_v1_block('block3', base_depth=256, num_units=23, stride=1),
resnet_v1.resnet_v1_block('block4', base_depth=512, num_units=3, stride=1),
]
调用D:\Anaconda3\Lib\site-packages\tensorflow\contrib\slim\python\slim\nets下的resnet_v1
再装一下cv2,升级numpy,easydict
然后就可以运行了