docker配置darknet2caffe问题及操作记录

创建volume挂载

docker run -i -t -v /d/Project/caffeFile:/mnt --name data bvlc/caffe:gpu /bin/bash

文件交互

cp指令

cp Makefile.config /mnt
cp /mnt/Makefile.config Makefile.config

报错cannot find -lopencv_imgcodecs

显而易见 缺少opencv3.x 库

apt-get update
apt-get install build-essential wget unzip
apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev

去GitHub上下载了一个opencv 解压到了交互文件夹里

放弃了OpenCV

把opencv重新注释,一切安好 可以编译成功

下载第三方转换库

git clone https://github.com/ChenYingpeng/darknet2caffe.git

网不好找不到,我去下了离线包

把离线包解压后放到交换文件夹里然后转到opt目录执行以下操作

cp -r /mnt/darknet2caffe-master ./

把所有文件都复制过来

接下来执行了以下操作

root@518ff3e7e8e3:/opt/darknet2caffe-master/caffe_layers/upsample_layer# cp upsample_layer.hpp /opt/caffe/include/caffe/layers

然后按照说明又挪了几个文件

root@518ff3e7e8e3:/opt/darknet2caffe-master/caffe_layers/mish_layer# cp mish_layer.cpp /opt/caffe/src/caffe/layers/
root@518ff3e7e8e3:/opt/darknet2caffe-master/caffe_layers/mish_layer# cp mish_layer.cu /opt/caffe/src/caffe/layers/
root@518ff3e7e8e3:/opt/darknet2caffe-master/caffe_layers/mish_layer# cd ..
root@518ff3e7e8e3:/opt/darknet2caffe-master/caffe_layers# cd upsample_layer/
root@518ff3e7e8e3:/opt/darknet2caffe-master/caffe_layers/upsample_layer# cp upsample_layer.cpp /opt/caffe/src/caffe/laye
rs/
root@518ff3e7e8e3:/opt/darknet2caffe-master/caffe_layers/upsample_layer# cp upsample_layer.cu /opt/caffe/src/caffe/layer
s/
root@518ff3e7e8e3:/opt/darknet2caffe-master/caffe_layers/pooling_layer# cp pooling_layer.cpp /opt/caffe/src/caffe/layers/

走了一遍,然后运行转换,报错没有pytorch什么的,想了想,重装了个cpu版本的康康

cpu 记录

按照帖子修改文档,build 文件夹下

make clean

python darknet2caffe.py ./yolov3_coco_416.cfg ./yolov3_coco_416.weights ./yolov3.prototxt ./yolov3.caffemodel

报错没有torch

使用pip下载pytorch

直接下载慢,改的离线包

pip install /mnt/torch-1.4.0-cp27-cp27mu-manylinux1_x86_64.whl

报错没有builtins

ImportError: No module named builtins

pip install future

报错没有upsamlpe

没思路了 放弃 现在回想有概率是因为重编译的caffe 可能没被认?

你可能感兴趣的:(docker,docker,caffe,深度学习)