docker中遇到的坑

快来打我* 2024-04-17 05:34 135阅读 0赞

-———————————————————————————————————————————————————————————————————————————————————

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

-———————————————————————————————————————————————————————————————————————————————————

问题1,update终止

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

  1. apt-get update

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

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

  1. docker pull ufoym/deepo:cpu

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

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

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

20190730105345646.png

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

20190730105517994.png

删除子镜像的被容器使用

2019073010574551.png

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

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0RpYW5hX1o_size_16_color_FFFFFF_t_70

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

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0RpYW5hX1o_size_16_color_FFFFFF_t_70 1

成功删除两个caffe的镜像

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

emmmmm

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

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

2、推荐镜像

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

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

  1. 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”

  1. NVCC src/caffe/3rdparty/reduce.cu
  2. 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).
  3. 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).
  4. src/caffe/3rdparty/reduce.cu(44): error: identifier "__shfl_down" is undefined
  5. detected during:
  6. 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>]"
  7. (76): here
  8. 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]"
  9. (124): here
  10. 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>]"
  11. (139): here
  12. 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>]"
  13. (149): here
  14. src/caffe/3rdparty/reduce.cu(44): error: identifier "__shfl_down" is undefined
  15. detected during:
  16. 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>]"
  17. (76): here
  18. 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]"
  19. (124): here
  20. 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>]"
  21. (139): here
  22. 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>]"
  23. (157): here
  24. 2 errors detected in the compilation of "/tmp/tmpxft_00000e20_00000000-14_reduce.compute_20.cpp1.ii".
  25. Makefile:594: recipe for target '.build_release/cuda/src/caffe/3rdparty/reduce.o' failed
  26. 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两行

  1. #CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
  2. # -gencode arch=compute_20,code=sm_21 \
  3. # -gencode arch=compute_30,code=sm_30 \
  4. # -gencode arch=compute_35,code=sm_35 \
  5. # -gencode arch=compute_50,code=sm_50 \
  6. # -gencode arch=compute_50,code=compute_50
  7. CUDA_ARCH := -gencode arch=compute_30,code=sm_30 \
  8. -gencode arch=compute_35,code=sm_35 \
  9. -gencode arch=compute_50,code=sm_50 \
  10. -gencode arch=compute_50,code=compute_50Z×ÓU

发表评论

表情:
评论列表 (有 0 条评论,135人围观)

还没有评论,来说两句吧...

相关阅读

    相关 Disruptor遇到

    经朋友推荐,我在项目采用lmax的disruptor无锁队列框架来实现异步记录监控统计信息。disruptor体积很小,功能强大,一路配置下来,很容易上手,而且经过测试发现确实