加入收藏 | 设为首页 | 会员中心 | 我要投稿 核心网 (https://www.hxwgxz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 移动互联 > 正文

基于ZStack构建深度学习云平台

发布时间:2019-02-14 22:35:12 所属栏目:移动互联 来源:朱天顺
导读:前言 深度学习是机器学习和人工智能研究的热门分支,也是当今最流行的科学研究趋势之一。深度学习方法为计算机视觉、机器学习带来了革命性的进步,而新的深度学习技术也正在不断诞生。由于深度学习正快速发展,新的研究者很难对这一技术实时跟进。国内各大

基于ZStack构建深度学习云平台

  1. 可以根据自身的环境选择相应版本进行下载,这个有身份验证只能浏览器下载然后再上传到云主机中。  
  2.   
  3. 安装:  
  4.   
  5. #rpm -ivh libcudnn7-7.4.2.24-1.cuda10.0.x86_64.rpm libcudnn7-devel-7.4.2.24-1.cuda10.0.x86_64.rpm libcudnn7-doc-7.4.2.24-1.cuda10.0.x86_64.rpm  
  6.   
  7. 准备中... ################################# [100%]  
  8.   
  9. 正在升级/安装...  
  10.   
  11. 1:libcudnn7-7.4.2.24-1.cuda10.0 ################################# [ 33%]  
  12.   
  13. 2:libcudnn7-devel-7.4.2.24-1.cuda10################################# [ 67%]  
  14.   
  15. 3:libcudnn7-doc-7.4.2.24-1.cuda10.0################################# [100%]  
  16.   
  17. 验证cuDNN:  
  18.   
  19. # cp -r /usr/src/cudnn_samples_v7/ $HOME  
  20.   
  21. # cd $HOME/cudnn_samples_v7/mnistCUDNN  
  22.   
  23. # make clean && make  
  24.   
  25. rm -rf *o  
  26.   
  27. rm -rf mnistCUDNN  
  28.   
  29. /usr/local/cuda/bin/nvcc -ccbin g++ -I/usr/local/cuda/include -IFreeImage/include -m64 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_53,code=sm_53 -gencode arch=compute_53,code=compute_53 -o fp16_dev.o -c fp16_dev.cu  
  30.   
  31. g++ -I/usr/local/cuda/include -IFreeImage/include -o fp16_emu.o -c fp16_emu.cpp  
  32.   
  33. g++ -I/usr/local/cuda/include -IFreeImage/include -o mnistCUDNN.o -c mnistCUDNN.cpp  
  34.   
  35. /usr/local/cuda/bin/nvcc -ccbin g++ -m64 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_53,code=sm_53 -gencode arch=compute_53,code=compute_53 -o mnistCUDNN fp16_dev.o fp16_emu.o mnistCUDNN.o -I/usr/local/cuda/include -IFreeImage/include -LFreeImage/lib/linux/x86_64 -LFreeImage/lib/linux -lcudart -lcublas -lcudnn -lfreeimage -lstdc++ -lm  
  36.   
  37. # ./mnistCUDNN  
  38.   
  39. cudnnGetVersion() : 7402 , CUDNN_VERSION from cudnn.h : 7402 (7.4.2)  
  40.   
  41. Host compiler version : GCC 4.8.5  
  42.   
  43. There are 1 CUDA capable devices on your machine :  
  44.   
  45. device 0 : sms 8 Capabilities 6.1, SmClock 1480.5 Mhz, MemSize (Mb) 5059, MemClock 3504.0 Mhz, Ecc=0, boardGroupID=0  
  46.   
  47. Using device 0  
  48.   
  49. Testing single precision  
  50.   
  51. Loading image data/one_28x28.pgm  
  52.   
  53. Performing forward propagation ...  
  54.   
  55. Testing cudnnGetConvolutionForwardAlgorithm ...  
  56.   
  57. Fastest algorithm is Algo 1  
  58.   
  59. Testing cudnnFindConvolutionForwardAlgorithm ...  
  60.   
  61. ^^^^ CUDNN_STATUS_SUCCESS for Algo 0: 0.036864 time requiring 0 memory  
  62.   
  63. ^^^^ CUDNN_STATUS_SUCCESS for Algo 1: 0.044032 time requiring 3464 memory  
  64.   
  65. ^^^^ CUDNN_STATUS_SUCCESS for Algo 2: 0.053248 time requiring 57600 memory  
  66.   
  67. ^^^^ CUDNN_STATUS_SUCCESS for Algo 4: 0.116544 time requiring 207360 memory  
  68.   
  69. ^^^^ CUDNN_STATUS_SUCCESS for Algo 7: 0.181248 time requiring 2057744 memory  
  70.   
  71. Resulting weights from Softmax:  
  72.   
  73. 0.0000000 0.9999399 0.0000000 0.0000000 0.0000561 0.0000000 0.0000012 0.0000017 0.0000010 0.0000000  
  74.   
  75. Loading image data/three_28x28.pgm  
  76.   
  77. Performing forward propagation ...  
  78.   
  79. Resulting weights from Softmax:  
  80.   
  81. 0.0000000 0.0000000 0.0000000 0.9999288 0.0000000 0.0000711 0.0000000 0.0000000 0.0000000 0.0000000  
  82.   
  83. Loading image data/five_28x28.pgm  
  84.   
  85. Performing forward propagation ...  
  86.   
  87. Resulting weights from Softmax:  
  88.   
  89. 0.0000000 0.0000008 0.0000000 0.0000002 0.0000000 0.9999820 0.0000154 0.0000000 0.0000012 0.0000006  
  90.   
  91. Result of classification: 1 3 5  
  92.   
  93. Test passed!  
  94.   
  95. Testing half precision (math in single precision)  
  96.   
  97. Loading image data/one_28x28.pgm  
  98.   
  99. Performing forward propagation ...  
  100.   
  101. Testing cudnnGetConvolutionForwardAlgorithm ...  
  102.   
  103. Fastest algorithm is Algo 1  
  104.   
  105. Testing cudnnFindConvolutionForwardAlgorithm ...  
  106.   
  107. ^^^^ CUDNN_STATUS_SUCCESS for Algo 0: 0.032896 time requiring 0 memory  
  108.   
  109. ^^^^ CUDNN_STATUS_SUCCESS for Algo 1: 0.036448 time requiring 3464 memory  
  110.   
  111. ^^^^ CUDNN_STATUS_SUCCESS for Algo 2: 0.044000 time requiring 28800 memory  
  112.   
  113. ^^^^ CUDNN_STATUS_SUCCESS for Algo 4: 0.115488 time requiring 207360 memory  
  114.   
  115. ^^^^ CUDNN_STATUS_SUCCESS for Algo 7: 0.180224 time requiring 2057744 memory  
  116.   
  117. Resulting weights from Softmax:  
  118.   
  119. 0.0000001 1.0000000 0.0000001 0.0000000 0.0000563 0.0000001 0.0000012 0.0000017 0.0000010 0.0000001  
  120.   
  121. Loading image data/three_28x28.pgm  
  122.   
  123. Performing forward propagation ...  
  124.   
  125. Resulting weights from Softmax:  
  126.   
  127. 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000714 0.0000000 0.0000000 0.0000000 0.0000000  
  128.   
  129. Loading image data/five_28x28.pgm  
  130.   
  131. Performing forward propagation ...  
  132.   
  133. Resulting weights from Softmax:  
  134.   
  135. 0.0000000 0.0000008 0.0000000 0.0000002 0.0000000 1.0000000 0.0000154 0.0000000 0.0000012 0.0000006  
  136.   
  137. Result of classification: 1 3 5  
  138.   
  139. Test passed!  
  140.   
  141. Test passed!且测试过程中无报错,表示测试通过!  

3.4安装 TensorFlow

  1. # pip3 install --upgrade setuptools==30.1.0 
  2.  
  3. # pip3 install tf-nightly-gpu 
  4.  
  5. 验证测试: 
  6.  
  7. 在 Python 交互式 shell 中输入以下几行简短的程序代码: 
  8.  
  9. # python  
  10. import tensorflow as tf  
  11. hello = tf.constant('Hello, TensorFlow!')  
  12. sess = tf.Session()  
  13. print(sess.run(hello)) 
  14.  
  15. 如果系统输出以下内容,就说明您可以开始编写 TensorFlow 程序了: 
  16.  
  17. Hello, TensorFlow! 
  18.  
  19. 同时使用nvidia-smi命令可以看到当前显卡的处理任务。 

(编辑:核心网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读