docker中遇到的坑

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------

------------重点分割线,掉坑是我进步的动力,有时候真的情愿不进步也不想掉坑啊啊啊啊-------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------

问题1,update终止

1、在安装vim的时候需要先执行

apt-get update

但是在执行update的时候执行到23步之后无法执行下去,可能是由于第一次在执行到23的时候出现断网,然后使用ctrl+C打断了跟新,反正之后就一直断在这一步。

下载一个新的镜像后在新的镜像里面执行成功

docker pull ufoym/deepo:cpu

推测删除后重新下载可以改变这个状态,删除已有镜像

参考:https://blog.csdn.net/winy_lm/article/details/77980529

           https://blog.csdn.net/jeikerxiao/article/details/78476925

删除镜像bvlc/caffe的时候报错,提示有子镜像没有删除,所以先删除子镜像caffe-mnist

删除子镜像的被容器使用

查看后发现caffe-mnist有很多容器,一个一个删除太麻烦了,所以就干脆全部一起删除

先停止全部容器,然后删除全部容器,查看确认容器删除

成功删除两个caffe的镜像

然而,重新下载caffe镜像之后,人就update失败

emmmmm

所以,那就,换一个镜像吧~~~

所以,那就,直接复制出来改好了再传回去吧~~~~

2、推荐镜像

地址:https://github.com/ufoym/deepo

里面提供了一个叫做deepo的镜像,在镜像里面已经安装了包括caffe,caffe2,tensoflow,torch等等深度学习框架。有cpu和gpu版本。

docker pull ufoym/deepo

gpu版本的下载

3、推荐教程

地址:https://zhuanlan.zhihu.com/p/63426143

这是一个使用deepo的cpu镜像实现ssh链接,然后通过ssh将容器编辑器链接Pycharm的教程。

在之前掉过一个坑,如果直接使用镜像链接Pycharm的话,可能只能将镜像中的python包导入到Pycharm里面去,但是比如caffe这种需要在环境中编译得到的就没法加载,所以需要将镜像的容器里面的python解释器导入到Pycharm里面,这个时候就需要使用ssh来链接了。

4、错误:

docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"/bash\": stat /bash: no such file or directory": unknown.

解决:

可能是下载过程中出现错误,重新执行docker pull ubuntu,在执行docker run -i -t ubuntu /bin/bash就OK了。

解决方法来源:

https://blog.csdn.net/weixin_43201726/article/details/82789002

5、make all 过程中错误,关键字"__shfl_down"

NVCC src/caffe/3rdparty/reduce.cu
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
src/caffe/3rdparty/reduce.cu(44): error: identifier "__shfl_down" is undefined
          detected during:
            instantiation of "T CTAReduce<NT, T, Rop>::reduce(int, T, CTAReduce<NT, T, Rop>::Storage &, int, Rop) [with NT=128, T=float, Rop=ctc_helper::add<float, float>]" 
(76): here
            instantiation of "void reduce_rows<NT,Iop,Rop,T>(Iop, Rop, const T *, T *, int, int) [with NT=128, Iop=ctc_helper::negate<float, float>, Rop=ctc_helper::add<float, float>, T=float]" 
(124): here
            instantiation of "void ReduceHelper::impl(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::negate<float, float>, Rof=ctc_helper::add<float, float>]" 
(139): here
            instantiation of "ctcStatus_t reduce(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::negate<float, float>, Rof=ctc_helper::add<float, float>]" 
(149): here

src/caffe/3rdparty/reduce.cu(44): error: identifier "__shfl_down" is undefined
          detected during:
            instantiation of "T CTAReduce<NT, T, Rop>::reduce(int, T, CTAReduce<NT, T, Rop>::Storage &, int, Rop) [with NT=128, T=float, Rop=ctc_helper::maximum<float, float>]" 
(76): here
            instantiation of "void reduce_rows<NT,Iop,Rop,T>(Iop, Rop, const T *, T *, int, int) [with NT=128, Iop=ctc_helper::identity<float, float>, Rop=ctc_helper::maximum<float, float>, T=float]" 
(124): here
            instantiation of "void ReduceHelper::impl(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::identity<float, float>, Rof=ctc_helper::maximum<float, float>]" 
(139): here
            instantiation of "ctcStatus_t reduce(Iof, Rof, const T *, T *, int, int, __nv_bool, cudaStream_t) [with T=float, Iof=ctc_helper::identity<float, float>, Rof=ctc_helper::maximum<float, float>]" 
(157): here

2 errors detected in the compilation of "/tmp/tmpxft_00000e20_00000000-14_reduce.compute_20.cpp1.ii".
Makefile:594: recipe for target '.build_release/cuda/src/caffe/3rdparty/reduce.o' failed
make: *** [.build_release/cuda/src/caffe/3rdparty/reduce.o] Error 1ce.o' failí

解决方法参考https://github.com/xmfbit/warpctc-caffe/issues/1

修改如下,上面被#注释的是原来的,下面没有注释的是新的,直接删除了sm_20和sm_21两行

#CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
#		-gencode arch=compute_20,code=sm_21 \
#		-gencode arch=compute_30,code=sm_30 \
#		-gencode arch=compute_35,code=sm_35 \
#		-gencode arch=compute_50,code=sm_50 \
#		-gencode arch=compute_50,code=compute_50

CUDA_ARCH := -gencode arch=compute_30,code=sm_30 \
		-gencode arch=compute_35,code=sm_35 \
		-gencode arch=compute_50,code=sm_50 \
		-gencode arch=compute_50,code=compute_50Z×ÓU?¥

 

 

 

 

 

 

 

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值