推荐搭配套餐:
- Python 2.7
- Keras 2.1.4
- OpenCV 2.4.13
- Tensorflow 1.3.0
或者:
- Python 3.5-3.6
- Keras 2.0.8
- OpenCV 3.4.0
- Tensorflow 1.3.0
安装:
1 本人套餐:
NVIDIA-SMI 384.130
CUDA Version 8.0.61
CUDNN_VERSION 6.0.21
pip install keras==2.1.4
pip install tensorflow-gpu==1.3.0
pip install opencv-python
2 下载h5格式的预训练文件,放入model文件夹:
https://www.dropbox.com/s/v6ueoa1g19bddao/model_frcnn.hdf5?dl=0
网页需要翻qiang下载,或者百度云下载:
链接: https://pan.baidu.com/s/1ZORTuXEoTNQHYkslLQW9vA 提取码: 5tui
3 运行:
运行detect.py 批量检测Dataset/Sampleinput下的图片,输出图片在Dataset/Sampleoutput
问题 1:
ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory
Failed to load the native TensorFlow runtime.
解决:
这是因为我装了tensorflow-gpu 1.5版本,而我用的是cuda 8.0和cudnn6.0,1.5版本要求cuda 9.0,我的做法就是回滚:
pip install tensorflow-gpu==1.3.0
问题 2:
File "/home/thu/anaconda3/lib/python3.5/site-packages/tensorflow/python/framework/common_shapes.py", line 659, in _call_cpp_shape_fn_impl
raise ValueError(err.message)
ValueError: Shape must be rank 1 but is rank 0 for 'bn_conv1/Reshape_4' (op: 'Reshape') with input shapes: [1,1,1,64], [].
解决:
pip install keras==2.1.4
问题 3:
OSError: Unable to open file (Unable to open file: name = 'model/model_frcnn.hdf5', errno = 2, error message = 'no such file or directory', flags = 0, o_flags = 0)
解决:
下载h5格式的预训练文件,放入model文件夹:
https://www.dropbox.com/s/v6ueoa1g19bddao/model_frcnn.hdf5?dl=0
网页需要翻qiang下载,或者百度云下载:
链接: https://pan.baidu.com/s/1ZORTuXEoTNQHYkslLQW9vA 提取码: 5tui
Ref: https://github.com/salman-h-khan/ZSD_Release