主要是参照这篇文章来的
添加链接描述
在执行
pip install -e .
时会因为requirement.txt中的这一行报错,所以注释掉这一行
nuscenes-devkit @ git+https://github.com/Fellfalla/nuscenes-devkit.git@master
然后自己去git clon这个文件,注意一定要clone Fellfalla的这个仓,因为这个仓可以在python3.5环境下使用,而主仓不可以。
git clone git@github.com:Fellfalla/nuscenes-devkit.git
打开自己的bashrc文件,将路径添加其中
export PYTHONPATH="${PYTHONPATH}:$PATH/nuscenes-devkit/python-sdk"
PATH为nuscenes-devkit所在的路径
随后执行
cd nuscenes-devkit
pip install -r requirements.txt
训练
python train_crfnet.py --config configs/crf_net.cfg
如果要训练或者测试nuscenes的mini数据集,需要改动config/crf_net.cfg中的
data_set = nuscenes,mini
运行验证功能,出现错误
python evaluate_crfnet.py --model saved_models/crf_net.h5 --config configs/crf_net.cfg --st 0.5
File "/home/sundong/anaconda3/envs/yolov3_i/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py", line 2675, in _call
fetched = self._callable_fn(*array_vals)
File "/home/sundong/anaconda3/envs/yolov3_i/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1439, in __call__
run_metadata_ptr)
File "/home/sundong/anaconda3/envs/yolov3_i/lib/python3.5/site-packages/tensorflow/python/framework/errors_impl.py", line 528, in __exit__
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InternalError: cudnn PoolForward launch failed
解决方法是加入以下几行代码
import tensorflow as tf
from tensorflow.compat.v1 import InteractiveSession
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
session = InteractiveSession(config=config)