-
Notifications
You must be signed in to change notification settings - Fork 0
/
深度學習環境配置指南! (Windows、Mac、Ubuntu全講解).html
1831 lines (1640 loc) · 302 KB
/
深度學習環境配置指南! (Windows、Mac、Ubuntu全講解).html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<!-- saved from url=(0049)https://mp.weixin.qq.com/s/EP0nPfgYrYTfg36iIGxM0g -->
<html class="translated-ltr"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style>body {transition: opacity ease-in 0.2s; }
body[unresolved] {opacity: 0; display: block; overflow: hidden; position: relative; }
</style>
<meta name="wechat-enable-text-zoom-em" content="true">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="color-scheme" content="light dark">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0,viewport-fit=cover">
<link rel="shortcut icon" type="image/x-icon" href="https://res.wx.qq.com/a/wx_fed/assets/res/NTI4MWU5.ico" reportloaderror="">
<link rel="mask-icon" href="https://res.wx.qq.com/a/wx_fed/assets/res/MjliNWVm.svg" color="#4C4C4C" reportloaderror="">
<link rel="apple-touch-icon-precomposed" href="https://res.wx.qq.com/a/wx_fed/assets/res/OTE0YTAw.png" reportloaderror="">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<script nonce="" reportloaderror="">try{document.getElementsByTagName('html').item(0).style.webkitTextSizeAdjust=JSON.parse(window.__wxWebEnv.getEnv()).fontScale+'%'}catch(e){}</script>
<script type="text/javascript" nonce="" reportloaderror="">
window.logs = { pagetime: {} };
window.logs.pagetime['html_begin'] = (+new Date());
window.LANG = "zh_TW"; // 页面语言 zh_CN en_US
</script>
<script type="text/javascript" nonce="" reportloaderror="">
/**
* 于2022-02-21重构vite
* 仅保留原有moon.js中上报相关的部分
* @author baakqiu
* @date 2022-02-21
*/
var WX_BJ_REPORT = window.WX_BJ_REPORT || {};
(function(_) {
if (_.BadJs) {
return;
}
//onerror上报名
var BADJS_WIN_ERR = 'BadjsWindowError';
var extend = function(source, destination) {
for (var property in destination) {
source[property] = destination[property]
}
return source
}
/*
出错上报字段:mid name key msg stack file col line uin
mid 模块名
name 监控名
key 特征值
msg 额外信息
*/
_.BadJs = {
uin: 0,
mid: "",
view: "wap",
_cache: {}, //上报_cache 同一mid name key 只会上报一次
_info: {}, // 打点记录 会写入msg帮助定位
_hookCallback: null,
ignorePath: true,
throw: function(e, extData) {
this.onError(e, extData);
throw e;
},
//接收异常并上报处理 如果有额外信息可以放在第二个参数_data中
// _data 只能覆盖上报协议的字段mid (name,key 不建议通过data覆盖) msg stack file col line uin
onError: function(e, extData) {
try {
//标记已执行的throw
if (e.BADJS_EXCUTED == true) {
return;
}
e.BADJS_EXCUTED = true;
var data = errToData(e);
data.uin = this.uin;
data.mid = this.mid;
data.view = this.view;
data.cmdb_module = 'mmbizwap';
//data.msg = msg || data.msg;
if (!!extData) {
data = extend(data, extData);
}
//如果cid存在 将cid合并到key
if (data.cid) {
data.key = "[" + data.cid + "]:" + data.key;
}
if (data._info) {
if (Object.prototype.toString.call(data._info) == "[object Object]") {
data.msg += " || info:" + JSON.stringify(data._info);
} else if (Object.prototype.toString.call(data._info) == "[object String]") {
data.msg += " || info:" + data._info;
} else {
data.msg += " || info:" + data._info;
}
}
if (typeof this._hookCallback == "function") {
if (this._hookCallback(data) === false) {
return
}
}
this._send(data);
return _.BadJs;
} catch (e) {
console.error(e);
}
},
winErr: function(event) {
if (event.error && event.error.BADJS_EXCUTED) {
return;
}
if (event.type === 'unhandledrejection') {
_.BadJs.onError(createError(event.type, event.reason, "", "", "", event.reason));
}else{
_.BadJs.onError(createError(BADJS_WIN_ERR, event.message, event.filename, event.lineno, event.colno, event.error));
}
},
init: function(uin, mid, view) {
this.uin = uin || this.uin;
this.mid = mid || this.mid;
this.view = view || this.view;
return _.BadJs;
},
//钩子函数
hook: function(fn) {
this._hookCallback = fn;
return _.BadJs;
},
_send: function(data) {
//hack uin mid
if (!data.mid) {
if (typeof window.PAGE_MID !== 'undefined' && window.PAGE_MID) {
data.mid = window.PAGE_MID;
} else {
return;
}
}
if (!data.uin) {
data.uin = window.user_uin || 0;
}
// 发送要去重
var flag = [data.mid, data.name, data.key].join("|");
if (this._cache && this._cache[flag]) {
return
} else {
this._cache && (this._cache[flag] = true);
this._xhr(data);
}
return _.BadJs;
},
_xhr: function(data) {
//console.log(data);
var xmlobj;
if (window.ActiveXObject) {
try {
xmlobj = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlobj = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlobj = false;
}
}
} else if (window.XMLHttpRequest) {
xmlobj = new XMLHttpRequest();
}
var param = "";
for (var key in data) {
if (key && data[key]) {
param += [key, "=", encodeURIComponent(data[key]), "&"].join("");
}
}
if (xmlobj && typeof xmlobj.open == "function") {
xmlobj.open("POST", "https://badjs.weixinbridge.com/report", true);
xmlobj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
xmlobj.onreadystatechange = function(status) {};
xmlobj.send(param.slice(0, -1));
} else {
var img = new Image();
img.src = "https://badjs.weixinbridge.com/report?" + param;
}
},
// key是特征值 默认上报msg就是key,也可以主动传msg包含更多上报信息
report: function(name, key, data) {
this.onError(createError(name, key), data);
return this;
},
// 打点标记
mark: function(info) {
this._info = extend(this._info, info);
},
nocache: function() {
this._cache = false;
return _.BadJs;
}
}
function createError(name, msg, url, line, col, error) {
return {
name: name || "",
message: msg || "",
file: url || "",
line: line || "",
col: col || "",
stack: (error && error.stack) || "",
}
}
//将异常错误转换成上报协议支持的字段
/*
* 先取e对象上的file line col等字段
* 再解析e.statck
* name 错误大类 默认取badjs_try_err|badjs_win_err
* key 错误标识 e.message
* msg 错误信息 e.message
* stack 错误堆栈 e.stack
* file 错误发生的文件
* line 行
* col 列
* client_version
*/
function errToData(e) {
var _stack = parseStack(e);
return {
name: e.name,
key: e.message,
msg: e.message,
stack: _stack.info,
file: _stack.file,
line: _stack.line,
col: _stack.col,
client_version: "",
_info: e._info
}
}
function parseStack(e) {
e._info = e._info || ""; // 当前错误的额外信息 最终上报到info
var stack = e.stack || "";
var _stack = {
info: stack,
file: e.file || "",
line: e.line || "",
col: e.col || "",
};
if (_stack.file == "") {
// 提取file line col
var stackArr = stack.split(/\bat\b/);
if (stackArr && stackArr[1]) {
var match = /(https?:\/\/[^\n]+)\:(\d+)\:(\d+)/.exec(stackArr[1]);
if (match) {
//若stack提取的file line col跟e中的属性不一致,以stack为准 但在e._info中记录原始数据
if (match[1] && match[1] != _stack.file) {
_stack.file && (e._info += " [file: " + _stack.file + " ]");
_stack.file = match[1];
}
if (match[2] && match[2] != _stack.line) {
_stack.line && (e._info += " [line: " + _stack.line + " ]");
_stack.line = match[2];
}
if (match[3] && match[3] != _stack.col) {
_stack.col && (e._info += " [col: " + _stack.col + " ]");
_stack.col = match[3];
}
}
}
}
//替换堆栈中的文件路径 combojs太长
if (_stack && _stack.file && _stack.file.length > 0) {
_stack.info = _stack.info.replace(new RegExp(_stack.file.split("?")[0], "gi"), "__FILE__")
}
//堆栈路径只保存文件名
if (_.BadJs.ignorePath) {
_stack.info = _stack.info.replace(/http(s)?\:[^:\n]*\//ig, "").replace(/\n/gi, "");
}
return _stack;
}
//兜底方法
window.addEventListener && window.addEventListener('error', _.BadJs.winErr);
window.addEventListener && window.addEventListener('unhandledrejection', _.BadJs.winErr);
return _.BadJs;
})(WX_BJ_REPORT);
window.WX_BJ_REPORT = WX_BJ_REPORT;
/**
* 兼容wap项目的简单CMD管理
* 所有wap项目必须包含此文件才可以执行成功
* 暴露在全局的变量仍然以seajs为命名空间,跟web项目保持一致
* 支持的API是seajs.use,以及require define
* @author raphealguo
* @date 20140326
*/
function __moonf__() {
if (window.__moonhasinit) return;
window.__moonhasinit = true;
window.__moonclientlog = []; // moon中存到客户端日志里面的内容,最终写入到客户端的地点在fereport.js
if (typeof JSON != "object") { //针对IE7的hack
window.JSON = {
stringify: function() { return ""; },
parse: function() { return {}; }
};
}
var moon_init = function() {
/**
* mooncatch
* 对各种异步回调都使用try catch错误上报
* @radeonwu raphealguo
*/
(function() {
var inWx = (/MicroMessenger/i).test(navigator.userAgent);
var inMp = (/MPAPP/i).test(navigator.userAgent);
var _idkey = 121261; //上报的idkey 添加默认上报值
var _startKey; //开始的key
var _limit; //上报的key的长度
var _badjsId;
var _reportOpt; //上报的额外信息
var _extInfo; //附加的预留字段,如网络采样率采样率network_rate, 总体上报率rate
var MOON_AJAX_NETWORK_OFFSET = 4; //network错误时的上报偏移量为4,这里在ajax.js中上报,这里需要加入采样率
window.__initCatch = function(opt) {
_idkey = opt.idkey;
_startKey = opt.startKey || 0;
_limit = opt.limit;
_badjsId = opt.badjsId;
_reportOpt = opt.reportOpt || "";
_extInfo = opt.extInfo || {};
_extInfo.rate = _extInfo.rate || 0.5;
}
//暴露的上报函数,供core.js和ajax.js上报错误使用,array = [{offset:MOON_JSAPI_KEY_OFFSET, log:"ready", e:e}]
window.__moon_report = function(array, rate_opt) {
var isAcrossOrigin = false;
var href = '';
try {
href = top.location.href;
} catch (e) {
isAcrossOrigin = true;
}
var rate = 0.5;
if (!!_extInfo && !!_extInfo.rate) {
rate = _extInfo.rate;
}
if (!!rate_opt && (typeof rate_opt == 'number')) {
rate = rate_opt;
}
if (
(!(/mp\.weixin\.qq\.com/).test(location.href) && !(/payapp\.weixin\.qq\.com/).test(location.href)) ||
Math.random() > rate ||
!(inWx || inMp) ||
(top != window && !isAcrossOrigin && !(/mp\.weixin\.qq\.com/).test(href))
) {
//return ;
}
if (isObject(array))
array = [array];
if (!isArray(array) || _idkey == '')
return;
var data = "";
var log = []; //存放array中每个对象关联的log
var key = []; //存放array中每个上报的key
var val = []; //存放array中每个上报的value
var idkey = [];
//如果这里没有opt.limit,直接上报到startKey
if (typeof _limit != "number") {
_limit = Infinity;
}
for (var i = 0; i < array.length; i++) {
var item = array[i] || {};
if (item.offset > _limit) continue; //上报的偏移量超过limit
if (typeof item.offset != "number") continue;
if (item.offset == MOON_AJAX_NETWORK_OFFSET && !!_extInfo && !!_extInfo.network_rate && Math.random() >= _extInfo.network_rate) {
continue;
}
//log[i] = item.log || "";
var k = _limit == Infinity ? _startKey : (_startKey + item.offset);
log[i] = (("[moon]" + _idkey + "_" + k + ";") + item.log + ";" + getErrorMessage(item.e || {})) || "";
key[i] = k;
val[i] = 1;
}
for (var j = 0; j < key.length; j++) {
idkey[j] = _idkey + "_" + key[j] + "_" + val[j];
data = data + "&log" + j + "=" + log[j];
}
if (idkey.length > 0) {
// sendReport("idkey=" + idkey.join(";") + "&lc=" + log.length + data);
sendReport("POST", location.protocol + '//mp.weixin.qq.com/mp/jsmonitor?', "idkey=" + idkey.join(";") + "&r=" + Math.random() + "&lc=" + log.length + data);
// 把图文消息的错误上报一份到badjs,只支持get请求
// 这里由于量比较大,把badjs的内层怼爆了,这里加多一个采样,并且去掉用户的信息
var rate = 1;
if (_extInfo && _extInfo.badjs_rate) { // 初始化时的badjs采样率
rate = _extInfo.badjs_rate;
}
if (Math.random() < rate) {
data = data.replace(/uin\:(.)*\|biz\:(.)*\|mid\:(.)*\|idx\:(.)*\|sn\:(.)*\|/, '');
if(!!_badjsId){
var _img = new Image();
var _src = 'https://badjs.weixinbridge.com/badjs?id=' + _badjsId + '&level=4&from=' + encodeURIComponent(location.host) + '&msg=' + encodeURIComponent(data);
_img.src = _src.slice(0, 1024);
}
// badjs同时报一份到新监控
if (typeof WX_BJ_REPORT != "undefined" && WX_BJ_REPORT.BadJs) {
for (var i = 0; i < array.length; i++) {
var item = array[i] || {};
if (item.e) {
WX_BJ_REPORT.BadJs.onError(item.e,{_info:item.log});
} else {
var name = /[^:;]*/.exec(item.log)[0];
WX_BJ_REPORT.BadJs.report(name, item.log, { mid: "mmbizwap:Monitor" });
}
}
}
} else {
//虽然采样没有执行 但实际是有被BadJs.onError,置位一下
for (var i = 0; i < array.length; i++) {
var item = array[i] || {};
if (item.e) {
item.e.BADJS_EXCUTED = true;
}
}
}
}
}
function isArray(obj) { //判断输入是否为数组
return Object.prototype.toString.call(obj) === '[object Array]';
}
function isObject(obj) { //判断输入是否为对象
return Object.prototype.toString.call(obj) === '[object Object]';
}
function getErrorMessage(e) {
var stack = e.stack + ' ' + e.toString() || ""; //错误堆栈信息
try {
//先取出res域名
if (!window.testenv_reshost) {
stack = stack.replace(/http(s)?:\/\/res\.wx\.qq\.com/g, "");
} else {
var host = 'http(s)?://' + window.testenv_reshost;
var reg = new RegExp(host, 'g');
stack = stack.replace(reg, "");
}
//提取最后一个.js前边的
var reg = /\/([^.]+)\/js\/(\S+?)\.js(\,|:)?/g;
while (reg.test(stack)) {
// stack = stack.replace(reg, "3"); 解决$问题
stack = stack.replace(reg, function(a, b, c, d, e, f) {
return c + d
});
}
} catch (e) {
stack = e.stack ? e.stack : "" //错误堆栈信息
}
var ret = [];
for (o in _reportOpt) {
if (_reportOpt.hasOwnProperty(o)) {
ret.push(o + ":" + _reportOpt[o]);
}
}
ret.push("STK:" + stack.replace(/\n/g, ""));
return ret.join("|");
}
function sendReport(type, url, data) { //post方法用于提交数据
if (!/^mp\.weixin\.qq\.com$/.test(location.hostname)) { //非MP域名使用 img方式上报
var tmp = [];
data = data.replace(location.href, (location.origin || "") + (location.pathname || "")).replace("#wechat_redirect", "").replace("#rd", "").split("&");
for (var i = 0, il = data.length; i < il; i++) {
var a = data[i].split("=");
if (!!a[0] && !!a[1]) {
tmp.push(a[0] + "=" + encodeURIComponent(a[1]));
}
}
var _img = new window.Image();
_img.src = (url + tmp.join("&")).substr(0, 1024);
return;
}
var xmlobj; //定义XMLHttpRequest对象
if (window.ActiveXObject) { //如果当前浏览器支持Active Xobject,则创建ActiveXObject对象
try {
xmlobj = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlobj = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlobj = false;
}
}
} else if (window.XMLHttpRequest) { //如果当前浏览器支持XMLHttpRequest,则创建XMLHttpRequest对象
xmlobj = new XMLHttpRequest();
}
if (!xmlobj) return;
//xmlobj.open("POST", location.protocol + "//mp.weixin.qq.com/mp/jsmonitor?", true);
xmlobj.open(type, url, true);
xmlobj.setRequestHeader("cache-control", "no-cache");
xmlobj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); //设置请求头信息
xmlobj.setRequestHeader("X-Requested-With", "XMLHttpRequest");
xmlobj.send(data); //发送数据
}
})();
// 后面的@cunjinli
};
moon_init();
//由于moon异步化,所以有些逻辑需要moon加载完之后才执行的 放到全局callback函数__moon_initcallback里边
(!!window.__moon_initcallback) && (window.__moon_initcallback());
}
// 为适应inline逻辑,有map时才主动自执行 @zhikaimai
// if (typeof window.moon_map == 'object') {
// __moonf__();
// }
__moonf__();
if (!!window.addEventListener){
window.addEventListener("load",function(){
var MOON_SCRIPT_ERROR_KEY_OFFSET = 1; //script上报时的偏移量为1
var ns = document.querySelectorAll("[reportloaderror]");
for(var ni=0,nl=ns.length;ni<nl;ni++)
ns[ni].onerror=function(ev){
window.__moon_report([{ offset: MOON_SCRIPT_ERROR_KEY_OFFSET, log: "load_script_error:" + ev.target.src, e: new Error('LoadResError') }], 1);
window.WX_BJ_REPORT.BadJs.report("load_script_error", ev.target.src, { mid: "mmbizwap:Monitor" });
};
});
}
</script>
<meta name="description" content="好文干货 作者:伍天舟、马曾欧、陈信达入门深度学习,很多人经历了从入门到放弃的心酸历程,且千军万马倒在了入">
<meta name="author" content="Datawhale">
<meta property="og:title" content="深度学习环境配置指南!(Windows、Mac、Ubuntu全讲解)">
<meta property="og:url" content="http://mp.weixin.qq.com/s?__biz=MzU0NjgzMDIxMQ==&mid=2247597845&idx=1&sn=ec219fa994520d56efc15f5d3f1c313b&chksm=fb549df9cc2314ef65a93353a14e0fd885bf58f0cb6dbf715e9beb8f2f0829b29dc775cac37c#rd">
<meta property="og:image" content="http://mmbiz.qpic.cn/mmbiz_jpg/hN1l83J6PhibP0b8bBb7FlPlYeV9RxG3icGMeQEUYs3jibjsPQSaKzOkib8ibYAc2WO0wQpXJZib1ic8qM3NdNYsms1GA/0?wx_fmt=jpeg">
<meta property="og:description" content="好文干货 作者:伍天舟、马曾欧、陈信达入门深度学习,很多人经历了从入门到放弃的心酸历程,且千军万马倒在了入">
<meta property="og:site_name" content="微信公众平台">
<meta property="og:type" content="article">
<meta property="og:article:author" content="Datawhale">
<meta property="twitter:card" content="summary">
<meta property="twitter:image" content="http://mmbiz.qpic.cn/mmbiz_jpg/hN1l83J6PhibP0b8bBb7FlPlYeV9RxG3icGMeQEUYs3jibjsPQSaKzOkib8ibYAc2WO0wQpXJZib1ic8qM3NdNYsms1GA/0?wx_fmt=jpeg">
<meta property="twitter:title" content="深度学习环境配置指南!(Windows、Mac、Ubuntu全讲解)">
<meta property="twitter:creator" content="Datawhale">
<meta property="twitter:site" content="微信公众平台">
<meta property="twitter:description" content="好文干货 作者:伍天舟、马曾欧、陈信达入门深度学习,很多人经历了从入门到放弃的心酸历程,且千军万马倒在了入">
<title>深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)</title>
<script type="text/javascript" nonce="" reportloaderror="">!function(){"use strict";var t=window.WebKitMutationObserver||window.MutationObserver||window.MozMutationObserver,e=0===location.href.indexOf("http://"),r=function(t){if(t){var e=t.match(/http(?:s)?:\/\/([^\/]+?)(\/|$)/);if(e&&!/qq\.com(\:8080)?$/.test(e[1])&&!/weishi\.com$/.test(e[1]))return!0}return!1};-1===location.href.indexOf("safe=0")&&e&&"function"==typeof t&&"mp.weixin.qq.com"===location.host&&(window.__observer_data={count:0,exec_time:0,list:[]},window.__observer=new t((function(t){window.__observer_data.count++;var e=new Date,o=[];t.forEach((function(t){for(var e=t.addedNodes,n=0;n<e.length;n++){var i=e[n];if("SCRIPT"===i.tagName){var _=i.src;r(_)&&(window.__observer_data.list.push(_),o.push(i)),!_&&window.__nonce_str&&i.getAttribute("nonce")!=window.__nonce_str&&(window.__observer_data.list.push("inlinescript_without_nonce"),o.push(i))}}}));for(var n=0;n<o.length;n++){var i=o[n];i.parentNode&&i.parentNode.removeChild(i)}window.__observer_data.exec_time+=new Date-e})),window.__observer.observe(document,{subtree:!0,childList:!0})),function(){if(-1===location.href.indexOf("safe=0")&&Math.random()<.01&&e&&HTMLScriptElement.prototype.__lookupSetter__&&void 0!==Object.defineProperty){window.__danger_src={xmlhttprequest:[],script_src:[],script_setAttribute:[]};var t="$"+Math.random(),o="Setter__";HTMLScriptElement.prototype.__old_method_script_src=HTMLScriptElement.prototype["__lookup"+o]("src"),HTMLScriptElement.prototype["__define"+o]("src",(function(t){t&&r(t)&&window.__danger_src.script_src.push(t),this.__old_method_script_src(t)}));var n="__setAttribute"+t;Object.defineProperty(Element.prototype,n,{value:Element.prototype.setAttribute,enumerable:!1}),Element.prototype.setAttribute=function(t,e){"SCRIPT"===this.tagName&&"src"===t&&r(e)&&window.__danger_src.script_setAttribute.push(e),this[n](t,e)}}}()}();</script><script type="text/javascript" secondopen="false" nonce="" reportloaderror="">!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Darkmode",[],t):"object"==typeof exports?exports.Darkmode=t():e.Darkmode=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=9)}([function(e,t,r){"use strict";var n=r(3),a=r(6),o=[].slice,i=["keyword","gray","hex"],l={};Object.keys(a).forEach((function(e){l[o.call(a[e].labels).sort().join("")]=e}));var s={};function u(e,t){if(!(this instanceof u))return new u(e,t);if(t&&t in i&&(t=null),t&&!(t in a))throw new Error("Unknown model: "+t);var r,c;if(null==e)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof u)this.model=e.model,this.color=e.color.slice(),this.valpha=e.valpha;else if("string"==typeof e){var h=n.get(e);if(null===h)throw new Error("Unable to parse color from string: "+e);this.model=h.model,c=a[this.model].channels,this.color=h.value.slice(0,c),this.valpha="number"==typeof h.value[c]?h.value[c]:1}else if(e.length){this.model=t||"rgb",c=a[this.model].channels;var f=o.call(e,0,c);this.color=d(f,c),this.valpha="number"==typeof e[c]?e[c]:1}else if("number"==typeof e)e&=16777215,this.model="rgb",this.color=[e>>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;var g=Object.keys(e);"alpha"in e&&(g.splice(g.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);var b=g.sort().join("");if(!(b in l))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=l[b];var p=a[this.model].labels,y=[];for(r=0;r<p.length;r++)y.push(e[p[r]]);this.color=d(y)}if(s[this.model])for(c=a[this.model].channels,r=0;r<c;r++){var m=s[this.model][r];m&&(this.color[r]=m(this.color[r]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}function c(e,t,r){return(e=Array.isArray(e)?e:[e]).forEach((function(e){(s[e]||(s[e]=[]))[t]=r})),e=e[0],function(n){var a;return arguments.length?(r&&(n=r(n)),(a=this[e]()).color[t]=n,a):(a=this[e]().color[t],r&&(a=r(a)),a)}}function h(e){return function(t){return Math.max(0,Math.min(e,t))}}function f(e){return Array.isArray(e)?e:[e]}function d(e,t){for(var r=0;r<t;r++)"number"!=typeof e[r]&&(e[r]=0);return e}u.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(e){var t=this.model in n.to?this:this.rgb(),r=1===(t=t.round("number"==typeof e?e:1)).valpha?t.color:t.color.concat(this.valpha);return n.to[t.model](r)},percentString:function(e){var t=this.rgb().round("number"==typeof e?e:1),r=1===t.valpha?t.color:t.color.concat(this.valpha);return n.to.rgb.percent(r)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var e={},t=a[this.model].channels,r=a[this.model].labels,n=0;n<t;n++)e[r[n]]=this.color[n];return 1!==this.valpha&&(e.alpha=this.valpha),e},unitArray:function(){var e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,1!==this.valpha&&e.push(this.valpha),e},unitObject:function(){var e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,1!==this.valpha&&(e.alpha=this.valpha),e},round:function(e){return e=Math.max(e||0,0),new u(this.color.map(function(e){return function(t){return function(e,t){return Number(e.toFixed(t))}(t,e)}}(e)).concat(this.valpha),this.model)},alpha:function(e){return arguments.length?new u(this.color.concat(Math.max(0,Math.min(1,e))),this.model):this.valpha},red:c("rgb",0,h(255)),green:c("rgb",1,h(255)),blue:c("rgb",2,h(255)),hue:c(["hsl","hsv","hsl","hwb","hcg"],0,(function(e){return(e%360+360)%360})),saturationl:c("hsl",1,h(100)),lightness:c("hsl",2,h(100)),saturationv:c("hsv",1,h(100)),value:c("hsv",2,h(100)),chroma:c("hcg",1,h(100)),gray:c("hcg",2,h(100)),white:c("hwb",1,h(100)),wblack:c("hwb",2,h(100)),cyan:c("cmyk",0,h(100)),magenta:c("cmyk",1,h(100)),yellow:c("cmyk",2,h(100)),black:c("cmyk",3,h(100)),x:c("xyz",0,h(100)),y:c("xyz",1,h(100)),z:c("xyz",2,h(100)),l:c("lab",0,h(100)),a:c("lab",1),b:c("lab",2),keyword:function(e){return arguments.length?new u(e):a[this.model].keyword(this.color)},hex:function(e){return arguments.length?new u(e):n.to.hex(this.rgb().round().color)},rgbNumber:function(){var e=this.rgb().color;return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},luminosity:function(){for(var e=this.rgb().color,t=[],r=0;r<e.length;r++){var n=e[r]/255;t[r]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast:function(e){var t=this.luminosity(),r=e.luminosity();return t>r?(t+.05)/(r+.05):(r+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},isDark:function(){var e=this.rgb().color;return(299*e[0]+587*e[1]+114*e[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var e=this.rgb(),t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten:function(e){var t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken:function(e){var t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate:function(e){var t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate:function(e){var t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten:function(e){var t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken:function(e){var t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale:function(){var e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return u.rgb(t,t,t)},fade:function(e){return this.alpha(this.valpha-this.valpha*e)},opaquer:function(e){return this.alpha(this.valpha+this.valpha*e)},rotate:function(e){var t=this.hsl(),r=t.color[0];return r=(r=(r+e)%360)<0?360+r:r,t.color[0]=r,t},mix:function(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);var r=e.rgb(),n=this.rgb(),a=void 0===t?.5:t,o=2*a-1,i=r.alpha()-n.alpha(),l=((o*i==-1?o:(o+i)/(1+o*i))+1)/2,s=1-l;return u.rgb(l*r.red()+s*n.red(),l*r.green()+s*n.green(),l*r.blue()+s*n.blue(),r.alpha()*a+n.alpha()*(1-a))}},Object.keys(a).forEach((function(e){if(-1===i.indexOf(e)){var t=a[e].channels;u.prototype[e]=function(){if(this.model===e)return new u(this);if(arguments.length)return new u(arguments,e);var r="number"==typeof arguments[t]?t:this.valpha;return new u(f(a[this.model][e].raw(this.color)).concat(r),e)},u[e]=function(r){return"number"==typeof r&&(r=d(o.call(arguments),t)),new u(r,e)}}})),e.exports=u},function(e,t,r){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},function(e,t,r){var n=r(7),a={};for(var o in n)n.hasOwnProperty(o)&&(a[n[o]]=o);var i=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var l in i)if(i.hasOwnProperty(l)){if(!("channels"in i[l]))throw new Error("missing channels property: "+l);if(!("labels"in i[l]))throw new Error("missing channel labels property: "+l);if(i[l].labels.length!==i[l].channels)throw new Error("channel and label counts mismatch: "+l);var s=i[l].channels,u=i[l].labels;delete i[l].channels,delete i[l].labels,Object.defineProperty(i[l],"channels",{value:s}),Object.defineProperty(i[l],"labels",{value:u})}i.rgb.hsl=function(e){var t,r,n=e[0]/255,a=e[1]/255,o=e[2]/255,i=Math.min(n,a,o),l=Math.max(n,a,o),s=l-i;return l===i?t=0:n===l?t=(a-o)/s:a===l?t=2+(o-n)/s:o===l&&(t=4+(n-a)/s),(t=Math.min(60*t,360))<0&&(t+=360),r=(i+l)/2,[t,100*(l===i?0:r<=.5?s/(l+i):s/(2-l-i)),100*r]},i.rgb.hsv=function(e){var t,r,n,a,o,i=e[0]/255,l=e[1]/255,s=e[2]/255,u=Math.max(i,l,s),c=u-Math.min(i,l,s),h=function(e){return(u-e)/6/c+.5};return 0===c?a=o=0:(o=c/u,t=h(i),r=h(l),n=h(s),i===u?a=n-r:l===u?a=1/3+t-n:s===u&&(a=2/3+r-t),a<0?a+=1:a>1&&(a-=1)),[360*a,100*o,100*u]},i.rgb.hwb=function(e){var t=e[0],r=e[1],n=e[2];return[i.rgb.hsl(e)[0],100*(1/255*Math.min(t,Math.min(r,n))),100*(n=1-1/255*Math.max(t,Math.max(r,n)))]},i.rgb.cmyk=function(e){var t,r=e[0]/255,n=e[1]/255,a=e[2]/255;return[100*((1-r-(t=Math.min(1-r,1-n,1-a)))/(1-t)||0),100*((1-n-t)/(1-t)||0),100*((1-a-t)/(1-t)||0),100*t]},i.rgb.keyword=function(e){var t=a[e];if(t)return t;var r,o,i,l=1/0;for(var s in n)if(n.hasOwnProperty(s)){var u=n[s],c=(o=e,i=u,Math.pow(o[0]-i[0],2)+Math.pow(o[1]-i[1],2)+Math.pow(o[2]-i[2],2));c<l&&(l=c,r=s)}return r},i.keyword.rgb=function(e){return n[e]},i.rgb.xyz=function(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255;return[100*(.4124*(t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*t+.7152*r+.0722*n),100*(.0193*t+.1192*r+.9505*n)]},i.rgb.lab=function(e){var t=i.rgb.xyz(e),r=t[0],n=t[1],a=t[2];return n/=100,a/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(a=a>.008856?Math.pow(a,1/3):7.787*a+16/116))]},i.hsl.rgb=function(e){var t,r,n,a,o,i=e[0]/360,l=e[1]/100,s=e[2]/100;if(0===l)return[o=255*s,o,o];t=2*s-(r=s<.5?s*(1+l):s+l-s*l),a=[0,0,0];for(var u=0;u<3;u++)(n=i+1/3*-(u-1))<0&&n++,n>1&&n--,o=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t,a[u]=255*o;return a},i.hsl.hsv=function(e){var t=e[0],r=e[1]/100,n=e[2]/100,a=r,o=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,a*=o<=1?o:2-o,[t,100*(0===n?2*a/(o+a):2*r/(n+r)),100*((n+r)/2)]},i.hsv.rgb=function(e){var t=e[0]/60,r=e[1]/100,n=e[2]/100,a=Math.floor(t)%6,o=t-Math.floor(t),i=255*n*(1-r),l=255*n*(1-r*o),s=255*n*(1-r*(1-o));switch(n*=255,a){case 0:return[n,s,i];case 1:return[l,n,i];case 2:return[i,n,s];case 3:return[i,l,n];case 4:return[s,i,n];case 5:return[n,i,l]}},i.hsv.hsl=function(e){var t,r,n,a=e[0],o=e[1]/100,i=e[2]/100,l=Math.max(i,.01);return n=(2-o)*i,r=o*l,[a,100*(r=(r/=(t=(2-o)*l)<=1?t:2-t)||0),100*(n/=2)]},i.hwb.rgb=function(e){var t,r,n,a,o,i,l,s=e[0]/360,u=e[1]/100,c=e[2]/100,h=u+c;switch(h>1&&(u/=h,c/=h),n=6*s-(t=Math.floor(6*s)),0!=(1&t)&&(n=1-n),a=u+n*((r=1-c)-u),t){default:case 6:case 0:o=r,i=a,l=u;break;case 1:o=a,i=r,l=u;break;case 2:o=u,i=r,l=a;break;case 3:o=u,i=a,l=r;break;case 4:o=a,i=u,l=r;break;case 5:o=r,i=u,l=a}return[255*o,255*i,255*l]},i.cmyk.rgb=function(e){var t=e[0]/100,r=e[1]/100,n=e[2]/100,a=e[3]/100;return[255*(1-Math.min(1,t*(1-a)+a)),255*(1-Math.min(1,r*(1-a)+a)),255*(1-Math.min(1,n*(1-a)+a))]},i.xyz.rgb=function(e){var t,r,n,a=e[0]/100,o=e[1]/100,i=e[2]/100;return r=-.9689*a+1.8758*o+.0415*i,n=.0557*a+-.204*o+1.057*i,t=(t=3.2406*a+-1.5372*o+-.4986*i)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(t=Math.min(Math.max(0,t),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},i.xyz.lab=function(e){var t=e[0],r=e[1],n=e[2];return r/=100,n/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(t-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},i.lab.xyz=function(e){var t,r,n,a=e[0];t=e[1]/500+(r=(a+16)/116),n=r-e[2]/200;var o=Math.pow(r,3),i=Math.pow(t,3),l=Math.pow(n,3);return r=o>.008856?o:(r-16/116)/7.787,t=i>.008856?i:(t-16/116)/7.787,n=l>.008856?l:(n-16/116)/7.787,[t*=95.047,r*=100,n*=108.883]},i.lab.lch=function(e){var t,r=e[0],n=e[1],a=e[2];return(t=360*Math.atan2(a,n)/2/Math.PI)<0&&(t+=360),[r,Math.sqrt(n*n+a*a),t]},i.lch.lab=function(e){var t,r=e[0],n=e[1];return t=e[2]/360*2*Math.PI,[r,n*Math.cos(t),n*Math.sin(t)]},i.rgb.ansi16=function(e){var t=e[0],r=e[1],n=e[2],a=1 in arguments?arguments[1]:i.rgb.hsv(e)[2];if(0===(a=Math.round(a/50)))return 30;var o=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(t/255));return 2===a&&(o+=60),o},i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])},i.rgb.ansi256=function(e){var t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},i.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var r=.5*(1+~~(e>50));return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},i.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var r;return e-=16,[Math.floor(e/36)/5*255,Math.floor((r=e%36)/6)/5*255,r%6/5*255]},i.rgb.hex=function(e){var t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},i.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var r=t[0];3===t[0].length&&(r=r.split("").map((function(e){return e+e})).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},i.rgb.hcg=function(e){var t,r=e[0]/255,n=e[1]/255,a=e[2]/255,o=Math.max(Math.max(r,n),a),i=Math.min(Math.min(r,n),a),l=o-i;return t=l<=0?0:o===r?(n-a)/l%6:o===n?2+(a-r)/l:4+(r-n)/l+4,t/=6,[360*(t%=1),100*l,100*(l<1?i/(1-l):0)]},i.hsl.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=1,a=0;return(n=r<.5?2*t*r:2*t*(1-r))<1&&(a=(r-.5*n)/(1-n)),[e[0],100*n,100*a]},i.hsv.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=t*r,a=0;return n<1&&(a=(r-n)/(1-n)),[e[0],100*n,100*a]},i.hcg.rgb=function(e){var t=e[0]/360,r=e[1]/100,n=e[2]/100;if(0===r)return[255*n,255*n,255*n];var a,o=[0,0,0],i=t%1*6,l=i%1,s=1-l;switch(Math.floor(i)){case 0:o[0]=1,o[1]=l,o[2]=0;break;case 1:o[0]=s,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=l;break;case 3:o[0]=0,o[1]=s,o[2]=1;break;case 4:o[0]=l,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=s}return a=(1-r)*n,[255*(r*o[0]+a),255*(r*o[1]+a),255*(r*o[2]+a)]},i.hcg.hsv=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t),n=0;return r>0&&(n=t/r),[e[0],100*n,100*r]},i.hcg.hsl=function(e){var t=e[1]/100,r=e[2]/100*(1-t)+.5*t,n=0;return r>0&&r<.5?n=t/(2*r):r>=.5&&r<1&&(n=t/(2*(1-r))),[e[0],100*n,100*r]},i.hcg.hwb=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],100*(r-t),100*(1-r)]},i.hwb.hcg=function(e){var t=e[1]/100,r=1-e[2]/100,n=r-t,a=0;return n<1&&(a=(r-n)/(1-n)),[e[0],100*n,100*a]},i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},i.gray.hsl=i.gray.hsv=function(e){return[0,0,e[0]]},i.gray.hwb=function(e){return[0,100,e[0]]},i.gray.cmyk=function(e){return[0,0,0,e[0]]},i.gray.lab=function(e){return[e[0],0,0]},i.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},i.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},function(e,t,r){var n=r(1),a=r(4),o=Object.hasOwnProperty,i={};for(var l in n)o.call(n,l)&&(i[n[l]]=l);var s=e.exports={to:{},get:{}};function u(e,t,r){return Math.min(Math.max(t,e),r)}function c(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}s.get=function(e){var t,r;switch(e.substring(0,3).toLowerCase()){case"hsl":t=s.get.hsl(e),r="hsl";break;case"hwb":t=s.get.hwb(e),r="hwb";break;default:t=s.get.rgb(e),r="rgb"}return t?{model:r,value:t}:null},s.get.rgb=function(e){if(!e)return null;var t,r,a,i=[0,0,0,1];if(t=e.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(a=t[2],t=t[1],r=0;r<3;r++){var l=2*r;i[r]=parseInt(t.slice(l,l+2),16)}a&&(i[3]=parseInt(a,16)/255)}else if(t=e.match(/^#([a-f0-9]{3,4})$/i)){for(a=(t=t[1])[3],r=0;r<3;r++)i[r]=parseInt(t[r]+t[r],16);a&&(i[3]=parseInt(a+a,16)/255)}else if(t=e.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(r=0;r<3;r++)i[r]=parseInt(t[r+1],0);t[4]&&(t[5]?i[3]=.01*parseFloat(t[4]):i[3]=parseFloat(t[4]))}else{if(!(t=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(t=e.match(/^(\w+)$/))?"transparent"===t[1]?[0,0,0,0]:o.call(n,t[1])?((i=n[t[1]])[3]=1,i):null:null;for(r=0;r<3;r++)i[r]=Math.round(2.55*parseFloat(t[r+1]));t[4]&&(t[5]?i[3]=.01*parseFloat(t[4]):i[3]=parseFloat(t[4]))}for(r=0;r<3;r++)i[r]=u(i[r],0,255);return i[3]=u(i[3],0,1),i},s.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var r=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,u(parseFloat(t[2]),0,100),u(parseFloat(t[3]),0,100),u(isNaN(r)?1:r,0,1)]}return null},s.get.hwb=function(e){if(!e)return null;var t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var r=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,u(parseFloat(t[2]),0,100),u(parseFloat(t[3]),0,100),u(isNaN(r)?1:r,0,1)]}return null},s.to.hex=function(){var e=a(arguments);return"#"+c(e[0])+c(e[1])+c(e[2])+(e[3]<1?c(Math.round(255*e[3])):"")},s.to.rgb=function(){var e=a(arguments);return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},s.to.rgb.percent=function(){var e=a(arguments),t=Math.round(e[0]/255*100),r=Math.round(e[1]/255*100),n=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+t+"%, "+r+"%, "+n+"%)":"rgba("+t+"%, "+r+"%, "+n+"%, "+e[3]+")"},s.to.hsl=function(){var e=a(arguments);return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},s.to.hwb=function(){var e=a(arguments),t="";return e.length>=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},s.to.keyword=function(e){return i[e.slice(0,3)]}},function(e,t,r){"use strict";var n=r(5),a=Array.prototype.concat,o=Array.prototype.slice,i=e.exports=function(e){for(var t=[],r=0,i=e.length;r<i;r++){var l=e[r];n(l)?t=a.call(t,o.call(l)):t.push(l)}return t};i.wrap=function(e){return function(){return e(i(arguments))}}},function(e,t){e.exports=function(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))}},function(e,t,r){var n=r(2),a=r(8),o={};Object.keys(n).forEach((function(e){o[e]={},Object.defineProperty(o[e],"channels",{value:n[e].channels}),Object.defineProperty(o[e],"labels",{value:n[e].labels});var t=a(e);Object.keys(t).forEach((function(r){var n=t[r];o[e][r]=function(e){var t=function(t){if(null==t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var r=e(t);if("object"==typeof r)for(var n=r.length,a=0;a<n;a++)r[a]=Math.round(r[a]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}(n),o[e][r].raw=function(e){var t=function(t){return null==t?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(n)}))})),e.exports=o},function(e,t,r){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},function(e,t,r){var n=r(2);function a(e){var t=function(){for(var e={},t=Object.keys(n),r=t.length,a=0;a<r;a++)e[t[a]]={distance:-1,parent:null};return e}(),r=[e];for(t[e].distance=0;r.length;)for(var a=r.pop(),o=Object.keys(n[a]),i=o.length,l=0;l<i;l++){var s=o[l],u=t[s];-1===u.distance&&(u.distance=t[a].distance+1,u.parent=a,r.unshift(s))}return t}function o(e,t){return function(r){return t(e(r))}}function i(e,t){for(var r=[t[e].parent,e],a=n[t[e].parent][e],i=t[e].parent;t[i].parent;)r.unshift(t[i].parent),a=o(n[t[i].parent][i],a),i=t[i].parent;return a.conversion=r,a}e.exports=function(e){for(var t=a(e),r={},n=Object.keys(t),o=n.length,l=0;l<o;l++){var s=n[l];null!==t[s].parent&&(r[s]=i(s,t))}return r}},function(e,t,r){"use strict";r.r(t),r.d(t,"run",(function(){return ye})),r.d(t,"init",(function(){return me})),r.d(t,"convertBg",(function(){return ve})),r.d(t,"extend",(function(){return ke}));var n="(prefers-color-scheme: dark)",a="data_color_scheme_dark",o="".concat(1*new Date).concat(Math.round(10*Math.random())),i="data-darkmode-color-".concat(o),l="data-darkmode-bgcolor-".concat(o),s="data-darkmode-original-color-".concat(o),u="data-darkmode-original-bgcolor-".concat(o),c="data-darkmode-bgimage-".concat(o),h=window.getInnerHeight&&window.getInnerHeight()||window.innerHeight||document.documentElement.clientHeight,f=["TABLE","TR","TD","TH"],d=/ !important$/,g={hasInit:!1,begin:null,showFirstPage:null,error:null,mode:"",whitelist:{tagName:["MPCPS","IFRAME"]},needJudgeFirstPage:!0,delayBgJudge:!1,container:null,cssSelectorsPrefix:"",defaultLightTextColor:"#191919",defaultLightBgColor:"#fff",defaultDarkTextColor:"#a3a3a3",defaultDarkBgColor:"#191919",set:function(e,t,r){var n=t[r];switch(e){case"boolean":"boolean"==typeof n&&(this[r]=n);break;case"string":"string"==typeof n&&""!==n&&(this[r]=n);break;case"function":"function"==typeof n&&(this[r]=n);break;case"dom":n instanceof HTMLElement&&(this[r]=n)}}};function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function m(e,t,r){return t&&y(e.prototype,t),r&&y(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var v=[],k=[],w=function(){function e(){p(this,e)}return m(e,[{key:"loopTimes",get:function(){return se.loopTimes}},{key:"isDarkmode",get:function(){return de.isDarkmode}},{key:"addCss",value:function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];(r?v:k).push(he.genCss(e,t.map((function(e){var t=e.key,r=e.value;return he.genCssKV(t,r)})).join("")))}}]),e}(),x=function(){function e(){p(this,e),b(this,"_plugins",[]),b(this,"length",0),b(this,"loopTimes",0),b(this,"firstPageStyle",""),b(this,"otherPageStyle",""),b(this,"firstPageStyleNoMQ",""),b(this,"otherPageStyleNoMQ","")}return m(e,[{key:"extend",value:function(e){this._plugins.push(new(e(w))),this.length++}},{key:"emit",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this._plugins.forEach((function(t){"function"==typeof t[e]&&t[e].apply(t,r)}))}},{key:"addCss",value:function(e){e?(this.firstPageStyle+=v.join(""),this.firstPageStyleNoMQ+=k.join("")):(this.otherPageStyle+=v.join(""),this.otherPageStyleNoMQ+=k.join(""))}},{key:"resetCss",value:function(){v=[],k=[]}}]),e}();function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function C(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var j=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),C(this,"_queue",[]),C(this,"_idx",0),this._prefix=t}var t,r,n;return t=e,(r=[{key:"push",value:function(e){var t="".concat(this._prefix).concat(this._idx++);e.classList.add(t),this._queue.push({el:e,className:t,updated:!g.delayBgJudge})}},{key:"forEach",value:function(e){var t=[];for(this._queue.forEach((function(r,n){r.updated&&(t.unshift(n),M(e)&&e(r.el))}));t.length;)this._queue.splice(t.shift(),1)}},{key:"update",value:function(e){this._queue.forEach((function(t){t.updated||Array.prototype.some.call(e,(function(e){return!(1!==e.nodeType||!e.classList.contains(t.className)||(t.el=e,t.updated=!0,0))}))}))}}])&&_(t.prototype,r),n&&_(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function P(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function S(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var A=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),S(this,"_stack",[]),S(this,"_idx",0),this._prefix=t}var t,r,n;return t=e,(r=[{key:"push",value:function(e,t){var r="".concat(this._prefix).concat(this._idx++);e.classList.add(r),this._stack.unshift({el:e,className:r,cssKV:t,updated:!g.delayBgJudge})}},{key:"contains",value:function(e,t){var r=e.getBoundingClientRect(),n=[];for(this._stack.forEach((function(e,t){if(e.updated){e.rect||(e.rect=e.el.getBoundingClientRect());var a=e.rect;r.top>=a.bottom||r.bottom<=a.top||r.left>=a.right||r.right<=a.left||n.unshift(t)}}));n.length;){var a=this._stack.splice(n.shift(),1)[0];"function"==typeof t&&t(a)}}},{key:"update",value:function(e){this._stack.forEach((function(t){t.updated||Array.prototype.some.call(e,(function(e){return!(1!==e.nodeType||!e.classList.contains(t.className)||(t.el=e,t.updated=!0,0))}))}))}}])&&P(t.prototype,r),n&&P(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function O(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return B(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return B(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function E(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var N=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),T(this,"_firstPageStyle",""),T(this,"_otherPageStyle",""),T(this,"isFinish",!1)}var t,r,o;return t=e,(r=[{key:"genCssKV",value:function(e,t){return"".concat(e,": ").concat(t," !important;")}},{key:"genCss",value:function(e,t){return"".concat("dark"===g.mode?"html.".concat(a," "):"").concat(g.cssSelectorsPrefix&&"".concat(g.cssSelectorsPrefix," "),".").concat(e,"{").concat(t,"}")}},{key:"addCss",value:function(e,t){this[t?"_firstPageStyle":"_otherPageStyle"]+=e,se.addCss(t)}},{key:"writeStyle",value:function(e){!e&&de.isDarkmode&&(this.isFinish=!0);var t=(de.isDarkmode?[{target:this,key:["_firstPageStyle","_otherPageStyle"],needMediaQuery:!0}]:[]).concat([{target:se,key:["firstPageStyle","otherPageStyle"],needMediaQuery:!0},{target:se,key:["firstPageStyleNoMQ","otherPageStyleNoMQ"],needMediaQuery:!1}]).map((function(t){var r=t.target,a=O(t.key,2),o=a[0],i=a[1],l=t.needMediaQuery,s="";e?s=o:(r[i]=r[o]+r[i],r[o]="",s=i);var u=r[s];return u?(r[s]="","dark"!==g.mode&&l?"@media ".concat(n," {").concat(u,"}"):u):""})).join("");t&&document.head.insertAdjacentHTML("beforeend",'<style type="text/css">'.concat(t,"</style>"))}}])&&E(t.prototype,r),o&&E(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function F(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function D(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function L(e){return function(e){if(Array.isArray(e))return q(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return q(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return q(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function I(e){var t;return(t=[e]).concat.apply(t,L(e.querySelectorAll("*")))}var z={"ue-table-interlace-color-single":"#fcfcfc","ue-table-interlace-color-double":"#f7faff"};var V=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),D(this,"_nodes",[]),D(this,"_firstPageNodes",[]),D(this,"_delayNodes",[]),D(this,"showFirstPage",!1)}var t,r,n;return t=e,(r=[{key:"length",get:function(){return this._nodes.length}},{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this._nodes=e}},{key:"get",value:function(){var e=[];return this._nodes.length?(e=this._nodes,de.isDarkmode&&(this._nodes=[])):this._delayNodes.length?(e=this._delayNodes,this._delayNodes=[]):g.container&&(e=g.container.querySelectorAll("*")),e}},{key:"delay",value:function(){var e=this;Array.prototype.forEach.call(this._nodes,(function(t){return e._delayNodes.push(t)})),this._nodes=[]}},{key:"hasDelay",value:function(){return this._delayNodes.length>0}},{key:"addFirstPageNode",value:function(e){this._firstPageNodes.push(e)}},{key:"showFirstPageNodes",value:function(){this._firstPageNodes.forEach((function(e){return e.style.visibility="visible"})),this.showFirstPage=!0}},{key:"emptyFirstPageNodes",value:function(){this._firstPageNodes=[]}}])&&F(t.prototype,r),n&&F(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),K=r(0),J=r.n(K),$=r(1),H=r.n($);function R(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}(e,t)||U(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Q(e){return function(e){if(Array.isArray(e))return G(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||U(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(e,t){if(e){if("string"==typeof e)return G(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?G(e,t):void 0}}function G(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function W(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function X(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}H.a.windowtext=[0,0,0],H.a.transparent=[255,255,255,0];var Y=new RegExp(Object.keys(H.a).map((function(e){return"\\b".concat(e,"\\b")})).join("|"),"ig"),Z=/\brgba?\([^)]+\)/i,ee=/\brgba?\([^)]+\)/gi,te=function(e){return e.replace(d,"")},re=function(e,t){return te(e).replace(Y,(function(e){if(!t&&"transparent"===e)return e;var r=H.a[e.toLowerCase()];return"".concat(r.length>3?"rgba":"rgb","(").concat(r.toString(),")")}))},ne=function(e){if(!e||e.length<1)return"";if(1===e.length)return e[0];for(var t=e.shift(),r=e.shift();r;){var n=J()(r);t=J()(t).mix(n,n.alpha()),r=e.shift()}return t},ae=function(e){var t=re(e);return Z.test(t)?t:""},oe=function(e){return(299*e[0]+587*e[1]+114*e[2])/1e3},ie=function(e,t){var r=e/oe(t),n=Math.min(255,t[0]*r),a=Math.min(255,t[1]*r),o=Math.min(255,t[2]*r);return 0===a||255===n||255===o?a=(1e3*e-299*n-114*o)/587:0===n?n=(1e3*e-587*a-114*o)/299:0!==o&&255!==a||(o=(1e3*e-299*n-587*a)/114),J.a.rgb(n,a,o)},le=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),X(this,"_idx",0),X(this,"_defaultDarkTextColorRgb",J()(g.defaultDarkTextColor).rgb().array()),X(this,"_defaultDarkBgColorRgb",J()(g.defaultDarkBgColor).rgb().array()),X(this,"_defaultDarkBgColorHSL",J()(g.defaultDarkBgColor).hsl().array()),X(this,"_defaultDarkTextColorBrightness",oe(this._defaultDarkTextColorRgb)),X(this,"_defaultDarkBgColorBrightness",oe(this._defaultDarkBgColorRgb)),X(this,"_defaultDarkBgColorHslBrightness",this._defaultDarkBgColorHSL[2]),X(this,"_maxLimitOffsetBrightness",this._defaultDarkTextColorBrightness-this._defaultDarkBgColorBrightness),X(this,"isDarkmode",!1)}var t,r,n;return t=e,(r=[{key:"_adjustTextBrightness",value:function(e,t){var r=t.rgb().array(),n=t.alpha(),a=oe(r)*n+this._defaultDarkBgColorBrightness*(1-n),o=e.rgb().array(),i=e.hsl().array(),l=e.alpha(),s=oe(o),u=Math.abs(a-s);if(s>=250)return e;if(u>this._maxLimitOffsetBrightness&&a<=this._defaultDarkBgColorBrightness+2)return ie(this._maxLimitOffsetBrightness+a,o).alpha(l);if(u>=65)return e;if(a>=100){if(i[2]>50){i[2]=90-i[2];var c=J.a.hsl.apply(J.a,Q(i)).alpha(l);return this._adjustTextBrightness(c,t)}return ie(Math.min(this._maxLimitOffsetBrightness,a-65),o).alpha(l)}if(i[2]<=40){i[2]=90-i[2];var h=J.a.hsl.apply(J.a,Q(i)).alpha(l);return this._adjustTextBrightness(h,t)}return ie(Math.min(this._maxLimitOffsetBrightness,a+65),o).alpha(l)}},{key:"_adjustBackgroundBrightness",value:function(e){var t=e.rgb().array(),r=e.hsl().array(),n=e.alpha(),a=oe(t),o=e;return 0===r[1]&&r[2]>40||a>250?o=J.a.hsl(0,0,Math.min(100,100+this._defaultDarkBgColorHslBrightness-r[2])):a>190?o=ie(190,t).alpha(n):r[2]<22&&(r[2]=22,o=J.a.hsl.apply(J.a,Q(r))),o.alpha(n).rgb()}},{key:"_adjustBrightness",value:function(e,t,r){var n,a=e.alpha(),o="";if(r.isBgColor){if(t.getAttribute(c)&&a>=.05&&t.removeAttribute(c),n=this._adjustBackgroundBrightness(e),!r.hasInlineColor){var s=t.getAttribute(i)||g.defaultLightTextColor,u=n||e,h=this._adjustBrightness(J()(s),t,{isTextColor:!0,parentElementBgColorStr:u});h.newColor?o+=he.genCssKV("color",h.newColor):o+=he.genCssKV("color",s)}}else if(r.isTextColor||r.isBorderColor){var f=r.parentElementBgColorStr||r.isTextColor&&t.getAttribute(l)||g.defaultDarkBgColor,d=J()(f);t.getAttribute(c)||(n=this._adjustTextBrightness(e,d),se.emit("afterConvertTextColor",t,{fontColor:n,bgColor:d}))}else r.isTextShadow&&(t.getAttribute(c)||(n=this._adjustBackgroundBrightness(e)));return{newColor:n&&e.toString()!==n.toString()&&n.alpha(a).rgb(),extStyle:o}}},{key:"_try",value:function(e){try{return e()}catch(e){console.log("An error occurred when running the dark mode conversion algorithm\n",e),"function"==typeof g.error&&g.error(e)}}},{key:"convert",value:function(e){var t=this;se.resetCss(),se.emit("beforeConvertNode",e);var r,n,a="";if(this.isDarkmode){var o=e.nodeName;if(g.whitelist.tagName.indexOf(o)>-1)return"";var h,b,p=e.style,y="",m=!1,v=!1,k=!1,w=(p.cssText&&p.cssText.split(";")||[]).map((function(e){var t=e.indexOf(":");return[e.slice(0,t).toLowerCase(),e.slice(t+1)].map((function(e){return(e||"").replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}))})).filter((function(e){var t=R(e,2),r=t[0],n=t[1];return"color"===r?m=!0:/background/i.test(r)&&(v=!0,"background-position"===r?h=n:"background-size"===r&&(b=n)),(/background/i.test(r)||/^(-webkit-)?border-image/.test(r))&&/url\([^)]*\)/i.test(n)&&(k=!0),["-webkit-border-image","border-image","color","background-color","background-image","background","border","border-top","border-right","border-bottom","border-left","border-color","border-top-color","border-right-color","border-bottom-color","border-left-color","-webkit-text-fill-color","-webkit-text-stroke","-webkit-text-stroke-color","text-shadow"].indexOf(r)>-1})).sort((function(e,t){var r=R(e,1)[0],n=R(t,1)[0];return"color"===r||"background-image"===r&&"background-color"===n||0===n.indexOf("-webkit-text")?1:-1}));f.indexOf(o)>-1&&!v&&this._try((function(){var t=function(e){var t=null;return Array.prototype.some.call(e.classList,(function(e){return!!z[e]&&(t=z[e],!0)})),t}(e);t||(t=e.getAttribute("bgcolor")),t&&(w.unshift(["background-color",J()(t).toString()]),v=!0)})),"FONT"!==o||m||this._try((function(){var t=e.getAttribute("color");t&&(w.push(["color",J()(t).toString()]),m=!0)}));var x="",M="",_=0;if(w.some((function(e,r){var n=R(e,2),a=n[0],o=n[1];return t._try((function(){if(0!==a.indexOf("-webkit-text"))return _=r,!0;switch(a){case"-webkit-text-fill-color":x=ae(o);break;case"-webkit-text-stroke":var e=o.split(" ");2===e.length&&(M=ae(e[1]));break;case"-webkit-text-stroke-color":M=ae(o)}return!1}))})),x&&(m?w[w.length-1]=["-webkit-text-fill-color",x]:(w.push(["-webkit-text-fill-color",x]),m=!0)),_&&(w.splice(0,_),M&&w.unshift(["-webkit-text-stroke-color",M])),w.forEach((function(r){var n=R(r,2),a=n[0],o=n[1];return t._try((function(){var r,n=o,f=!1,w=/^background/.test(a),x="text-shadow"===a,M=["-webkit-text-stroke-color","color","-webkit-text-fill-color"].indexOf(a),_=/^border/.test(a),C=/gradient/.test(o),j=[],P="";if(o=re(o,C),Z.test(o)){if(C){for(var S=ee.exec(o);S;)j.push(S[0]),S=ee.exec(o);r=ne(j)}var A=0;o=o.replace(ee,(function(n){C&&(n=r,f=!0);var a=t._adjustBrightness(J()(n),e,{isBgColor:w,isTextShadow:x,isTextColor:M>-1,isBorderColor:_,hasInlineColor:m}),o=!k&&a.newColor;if(P+=a.extStyle,w||M>0){var h=w?l:i,d=w?u:s,b=o?o.toString():n;0===A&&I(e).forEach((function(e){var t=e.getAttribute(d)||g.defaultLightBgColor;e.setAttribute(h,b),e.setAttribute(d,t.split("|").concat(n).join("|")),w&&J()(b).alpha()>=.05&&e.getAttribute(c)&&e.removeAttribute(c)}))}return o&&(f=!0),A+=1,o||n})).replace(/\s?!\s?important/gi,"")}if(P&&(y+=P),!(e instanceof SVGElement)){var O=/^background/.test(a),B=/^(-webkit-)?border-image/.test(a);if((O||B)&&/url\([^)]*\)/i.test(o)){f=!0;var E=ne((e.getAttribute(u)||g.defaultLightBgColor).split("|"));if(o=o.replace(/^(.*?)url\(([^)]*)\)(.*)$/i,(function(t){var r=t,n="",o="",i="";return"1"!==e.getAttribute(c)&&I(e).forEach((function(e){return e.setAttribute(c,"1")})),O?(r="linear-gradient(".concat("rgba(0,0,0,0.2)",", ").concat("rgba(0,0,0,0.2)","),").concat(t),i=he.genCssKV(a,"".concat(r,",linear-gradient(").concat(E,", ").concat(E,")")),h&&(n="top left,".concat(h),y+=he.genCssKV("background-position","".concat(n)),i+=he.genCssKV("background-position","".concat(n,",top left"))),b&&(o="100%,".concat(b),y+=he.genCssKV("background-size","".concat(o)),i+=he.genCssKV("background-size","".concat(o,",100%"))),ce.push(e,i)):!v&&ce.push(e,he.genCssKV("background-image","linear-gradient(".concat("rgba(0,0,0,0.2)",", ").concat("rgba(0,0,0,0.2)","),linear-gradient(").concat(E,", ").concat(E,")"))),r})),!m){var T=ne((e.getAttribute(s)||g.defaultLightTextColor).split("|"));y+=he.genCssKV("color",T),I(e).forEach((function(e){return e.setAttribute(i,T)}))}}}f&&(d.test(n)&&(p[a]=te(n)),C?ce.push(e,he.genCssKV(a,o)):y+=he.genCssKV(a,o))}))})),y){e.setAttribute("data-style",p.cssText);var C="".concat("js_darkmode__").concat(this._idx++);e.classList.add(C),a+=y?he.genCss(C,y):""}r=e,n="",Array.prototype.forEach.call(r.childNodes,(function(e){3===e.nodeType&&(n+=e.nodeValue.replace(/\s/g,""))})),n.length>0&&(g.delayBgJudge?ue.push(e):ce.contains(e,(function(e){a+=he.genCss(e.className,e.cssKV)})))}return se.emit("afterConvertNode",e),a}}])&&W(t.prototype,r),n&&W(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),se=new x,ue=new j("".concat("js_darkmode__","text__")),ce=new A("".concat("js_darkmode__","bg__")),he=new N,fe=new V,de=new le,ge=new RegExp("".concat("js_darkmode__","[^ ]+"),"g"),be=null,pe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{type:"dom"};if(t.force&&(he.isFinish=!1),!he.isFinish)try{de.isDarkmode=g.mode?"dark"===g.mode:e.matches,"dom"===t.type?(de.isDarkmode&&"function"==typeof g.begin&&g.begin(fe.hasDelay()),Array.prototype.forEach.call(fe.get(),(function(e){if(de.isDarkmode&&e.className&&"string"==typeof e.className&&(e.className=e.className.replace(ge,"")),de.isDarkmode||se.length)if(g.needJudgeFirstPage){var t=e.getBoundingClientRect(),r=t.top,n=t.bottom;r<=0&&n<=0?he.addCss(de.convert(e),!1):r>0&&r<h||n>0&&n<h?(fe.addFirstPageNode(e),he.addCss(de.convert(e),!0)):(g.needJudgeFirstPage=!1,he.writeStyle(!0),fe.showFirstPageNodes(),"function"==typeof g.showFirstPage&&g.showFirstPage(),he.addCss(de.convert(e),!1))}else he.addCss(de.convert(e),!1)})),se.loopTimes++):"bg"===t.type&&de.isDarkmode&&ue.forEach((function(e){return ce.contains(e,(function(e){he.addCss(he.genCss(e.className,e.cssKV),!1)}))})),(g.needJudgeFirstPage||!g.needJudgeFirstPage&&!fe.showFirstPage)&&"function"==typeof g.showFirstPage&&g.showFirstPage(),he.writeStyle(),fe.emptyFirstPageNodes(),de.isDarkmode||(g.needJudgeFirstPage=!1,g.delayBgJudge=!1,null===g.container&&"dom"===t.type&&fe.length&&fe.delay())}catch(e){console.log("An error occurred when running the dark mode conversion algorithm\n",e),"function"==typeof g.error&&g.error(e)}};function ye(e,t){me(t),fe.set(e),pe(be,{force:!0,type:"dom"})}function me(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!g.hasInit){g.hasInit=!0;var t=g.whitelist.tagName;e.whitelist&&e.whitelist.tagName instanceof Array&&e.whitelist.tagName.forEach((function(e){e=e.toUpperCase(),-1===t.indexOf(e)&&t.push(e)})),["dark","light"].indexOf(e.mode)>-1&&(g.set("string",e,"mode"),document.getElementsByTagName("html")[0].classList.add(a)),g.set("function",e,"begin"),g.set("function",e,"showFirstPage"),g.set("function",e,"error"),g.set("boolean",e,"needJudgeFirstPage"),g.set("boolean",e,"delayBgJudge"),g.set("dom",e,"container"),g.set("string",e,"cssSelectorsPrefix"),g.set("string",e,"defaultLightTextColor"),g.set("string",e,"defaultLightBgColor"),g.set("string",e,"defaultDarkTextColor"),g.set("string",e,"defaultDarkBgColor"),!g.mode&&null===be&&window.matchMedia&&(be=window.matchMedia(n)).addListener(pe)}}function ve(e){fe.set(e),null!==g.container&&(ce.update(e),ue.update(e)),pe(be,{force:!0,type:"bg"})}function ke(e){e.forEach((function(e){return se.extend(e)}))}}])}));</script>
<script type="module" nonce="" reportloaderror="">!function(){try{new Function("m","return import(m)")}catch(o){console.warn("vite: loading legacy build because dynamic import is unsupported, syntax error above should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}}();</script>
<script type="module" crossorigin="" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/appmsg.l78s9vbv7171dab8.js.下載" nonce="" reportloaderror=""></script>
<link rel="modulepreload" href="https://res.wx.qq.com/mmbizappmsg/zh_CN/htmledition/js/assets/modulepreload-polyfill.l78s9vbv9f4fdae5.js" reportloaderror="">
<link rel="modulepreload" href="https://res.wx.qq.com/mmbizappmsg/zh_CN/htmledition/js/assets/vendor.l78s9vbv2cfcb095.js" reportloaderror="">
<link rel="modulepreload" href="https://res.wx.qq.com/mmbizappmsg/zh_CN/htmledition/js/assets/event.l78s9vbve62f4124.js" reportloaderror="">
<link rel="modulepreload" href="https://res.wx.qq.com/mmbizappmsg/zh_CN/htmledition/js/assets/comm_utils.l78s9vbv1a6e8d21.js" reportloaderror="">
<link rel="modulepreload" href="https://res.wx.qq.com/mmbizappmsg/zh_CN/htmledition/js/assets/class.l78s9vbv86ce5555.js" reportloaderror="">
<link rel="modulepreload" href="https://res.wx.qq.com/mmbizappmsg/zh_CN/htmledition/js/assets/comm_report.l78s9vbvb03c5672.js" reportloaderror="">
<link rel="modulepreload" href="https://res.wx.qq.com/mmbizappmsg/zh_CN/htmledition/js/assets/appmsgext.l78s9vbvd308a8d8.js" reportloaderror="">
<link rel="modulepreload" href="https://res.wx.qq.com/mmbizappmsg/zh_CN/htmledition/js/assets/page_utils.l78s9vbvd447a586.js" reportloaderror="">
<link rel="modulepreload" href="https://res.wx.qq.com/mmbizappmsg/zh_CN/htmledition/js/assets/vueComponentNormalizer.l78s9vbv0987931f.js" reportloaderror="">
<link rel="modulepreload" href="https://res.wx.qq.com/mmbizappmsg/zh_CN/htmledition/js/assets/weui_a11y.l78s9vbvb85f2b11.js" reportloaderror="">
<link rel="modulepreload" href="https://res.wx.qq.com/mmbizappmsg/zh_CN/htmledition/js/assets/wxwork_hidden.l78s9vbva845793d.js" reportloaderror="">
<link rel="modulepreload" href="https://res.wx.qq.com/mmbizappmsg/zh_CN/htmledition/js/assets/loadscript.l78s9vbve0fda9f4.js" reportloaderror="">
<link rel="modulepreload" href="https://res.wx.qq.com/mmbizappmsg/zh_CN/htmledition/js/assets/voice_component.l78s9vbv94af3347.js" reportloaderror="">
<link rel="modulepreload" href="https://res.wx.qq.com/mmbizappmsg/zh_CN/htmledition/js/assets/outer_link.l78s9vbvc8156974.js" reportloaderror="">
<link rel="modulepreload" href="https://res.wx.qq.com/mmbizappmsg/zh_CN/htmledition/js/assets/dom.l78s9vbvf8db8dd1.js" reportloaderror="">
<link rel="modulepreload" href="https://res.wx.qq.com/mmbizappmsg/zh_CN/htmledition/js/assets/review_image.l78s9vbv37832b8f.js" reportloaderror="">
<link rel="modulepreload" href="https://res.wx.qq.com/mmbizappmsg/zh_CN/htmledition/js/assets/set_article_read.l78s9vbv9903d8f7.js" reportloaderror="">
<link rel="modulepreload" href="https://res.wx.qq.com/mmbizappmsg/zh_CN/htmledition/js/assets/danmu_util.l78s9vbv2ede9518.js" reportloaderror="">
<link rel="modulepreload" href="https://res.wx.qq.com/mmbizappmsg/zh_CN/htmledition/js/assets/controller.l78s9vbvf0cac5b8.js" reportloaderror="">
<link rel="modulepreload" href="https://res.wx.qq.com/mmbizappmsg/zh_CN/htmledition/js/assets/see_more.l78s9vbvd6eaf298.js" reportloaderror="">
<link rel="modulepreload" href="https://res.wx.qq.com/mmbizappmsg/zh_CN/htmledition/js/assets/background_color.l78s9vbv110a7bdb.js" reportloaderror="">
<link rel="modulepreload" href="https://res.wx.qq.com/mmbizappmsg/zh_CN/htmledition/js/assets/modal.l78s9vbv7d9a41a5.js" reportloaderror="">
<link rel="stylesheet" href="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/weui_a11y.l78s9vbvfa1e3285.css" reportloaderror="">
<link rel="stylesheet" href="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/wxwork_hidden.l78s9vbv36e3976a.css" reportloaderror="">
<link rel="stylesheet" href="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/controller.l78s9vbvb7abd7b9.css" reportloaderror="">
<link rel="stylesheet" href="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/see_more.l78s9vbv3d89d3d2.css" reportloaderror="">
<link rel="stylesheet" href="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/appmsg.l78s9vbvb8777721.css" reportloaderror="">
<link rel="stylesheet" href="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/tencent_portfolio_light.l78s9vbv3945de52.css" reportloaderror="">
<link rel="stylesheet" href="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/index.l78s9vbv56243de9.css" reportloaderror="">
<style>
.cooldown_tips {
margin: 30px auto;
margin-top: 0;
display: flex;
align-items: center;
padding: 10px;
font-size: 14px;
background-color: #f6f7f9;
border-radius: 6px;
}
.cooldown_tips_icon {
display: block;
width: 18px;
height: 18px;
margin-right: 8px;
}
</style>
<link href="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/weui.min.css" rel="stylesheet"><link type="text/css" rel="stylesheet" charset="UTF-8" href="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/translateelement.css"></head>
<body id="activity-detail" class="zh_CN wx_wap_page wx_wap_desktop_fontsize_2 mm_appmsg comment_feature discuss_tab appmsg_skin_default appmsg_style_default pages_skin_pc not_in_mm">
<script type="text/javascript" nonce="" reportloaderror="">
var biz = "MzU0NjgzMDIxMQ==" || "";
var sn = "ec219fa994520d56efc15f5d3f1c313b" || "" || "";
var mid = "2247597845" || "" || "";
var idx = "1" || "" || "";
window.__allowLoadResFromMp = true; // 允许从mp.weixin.qq.com加载js资源
// window.__loadAllResFromMp = true; // 所有js资源都从mp域名加载
</script>
<script nonce="" reportloaderror="">
var page_begintime = (+new Date());
// 辟谣需求
var is_rumor = "";
var norumor = "";
if (!!(is_rumor * 1) && !(norumor*1) && !!biz && !!mid) {
if (!document.referrer || document.referrer.indexOf("mp.weixin.qq.com/mp/rumor") == -1){
location.href = "http://mp.weixin.qq.com/mp/rumor?action=info&__biz=" + biz + "&mid=" + mid + "&idx=" + idx + "&sn=" + sn + "#wechat_redirect";
}
}
</script>
<link rel="dns-prefetch" href="https://res.wx.qq.com/" reportloaderror="">
<link rel="dns-prefetch" href="https://mmbiz.qpic.cn/" reportloaderror="">
<link rel="dns-prefetch" href="https://wxa.wxs.qq.com/" reportloaderror="">
<link rel="shortcut icon" type="image/x-icon" href="https://res.wx.qq.com/a/wx_fed/assets/res/NTI4MWU5.ico" reportloaderror="">
<link rel="mask-icon" href="https://res.wx.qq.com/a/wx_fed/assets/res/MjliNWVm.svg" color="#4C4C4C" reportloaderror="">
<link rel="apple-touch-icon-precomposed" href="https://res.wx.qq.com/a/wx_fed/assets/res/OTE0YTAw.png" reportloaderror="">
<script type="text/javascript" nonce="" reportloaderror="">
String.prototype.html = function (encode) {
var replace = ["'", "'", """, '"', " ", " ", ">", ">", "<", "<", "¥", "¥", "&", "&"];
// 最新版的safari 12有一个BUG,如果使用字面量定义一个数组,var a = [1, 2, 3]
// 当调用了 a.reverse() 方法把变量 a 元素顺序反转成 3, 2, 1 后,
// 即使此页面刷新了, 或者此页面使用 A标签、 window.open 打开的页面,
// 只要调用到同一段代码, 变量 a 的元素顺序都会变成 3, 2, 1
// 所以这里不用 reverse 方法
/*
if (encode) {
replace.reverse();
}*/
var replaceReverse = ["&", "&", "¥", "¥", "<", "<", ">", ">", " ", " ", '"', """, "'", "'"];
var target;
if (encode) {
target = replaceReverse;
} else {
target = replace;
}
for (var i = 0, str = this; i < target.length; i += 2) {
str = str.replace(new RegExp(target[i], 'g'), target[i + 1]);
}
return str;
};
window.isInWeixinApp = function () {
return /MicroMessenger/.test(navigator.userAgent);
};
window.getQueryFromURL = function (url) {
url = url || 'http://qq.com/s?a=b#rd'; // 做一层保护,保证URL是合法的
var tmp = url.split('?'),
query = (tmp[1] || "").split('#')[0].split('&'),
params = {};
for (var i = 0; i < query.length; i++) {
var arg = query[i].split('=');
params[arg[0]] = arg[1];
}
if (params['pass_ticket']) {
params['pass_ticket'] = encodeURIComponent(params['pass_ticket'].html(false).html(false).replace(/\s/g, "+"));
}
return params;
};
(function () {
var params = getQueryFromURL(location.href);
window.uin = params['uin'] || "" || '';
window.key = params['key'] || "" || '';
window.wxtoken = params['wxtoken'] || '';
window.pass_ticket = params['pass_ticket'] || '';
window.appmsg_token = "";
var ua = navigator.userAgent;
if (ua.match(/Mac\sOS\sX\s(\d+[\.|_]\d+)/) || ua.match(/Windows(\s+\w+)?\s+?(\d+\.\d+)/) || ua.match(/Linux\s/)) {
document.body.classList.add('pages_skin_pc');
}
})();
</script>
<script type="text/javascript" nonce="" reportloaderror="">window.PAGE_MID="mmbizwap:appmsg/newindex.html"</script>
<script type="text/javascript" nonce="" reportloaderror="">
var write_sceen_time = (+new Date());
var preview = "" * 1 || 0;
var currencyMap = {
'USD': '$',
'HKD': 'HK$',
'CAD': 'C$',
'AUD': 'A$',
'TWD': 'NT$',
'JPY': 'JPY¥',
'EUR': '€',
'SGD': 'S$',
'GBP': '£',
'NZD': 'NZ$',
'MYR': 'RM',
'KZT': '〒',
'KRW': '₩',
'THB': '฿',
'PHP': '₱',
'TRY': '₺',
'MXN': 'Mex$',
'CNY': '¥'
};
var can_use_wecoin = '1' * 1; // 是否个人号
var wecoin_tips = '0' * 1; // 是否出教育弹窗
/* var can_use_wecoin = 1; */
var wecoin_amount = '0' * 1; // 微信豆个数
</script>
<div id="js_article" style="position:relative;" class="rich_media">
<div id="js_top_ad_area" class="top_banner"></div>
<div id="js_base_container" class="rich_media_inner">
<div id="page-content" class="rich_media_area_primary">
<div class="rich_media_area_primary_inner">
<div id="img-content" class="rich_media_wrp">
<h1 class="rich_media_title " id="activity-name"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">
深度學習環境配置指南!</font><font style="vertical-align: inherit;">(Windows、Mac、Ubuntu全講解)
</font></font></h1>
<div id="meta_content" class="rich_media_meta_list">
<span class="rich_media_meta rich_media_meta_nickname" id="profileBt">
<a href="javascript:void(0);" class="wx_tap_link js_wx_tap_highlight weui-wa-hotarea" id="js_name"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">
小白學視覺 </font></font></a>
<div id="js_profile_qrcode" aria-hidden="true" class="profile_container" style="display:none;">
<div class="profile_inner">
<strong class="profile_nickname"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">小白學視覺</font></font></strong>
<img class="profile_avatar" id="js_profile_qrcode_img" src="https://mp.weixin.qq.com/s/EP0nPfgYrYTfg36iIGxM0g" alt="">
<p class="profile_meta">
<label class="profile_meta_label"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">微信號</font></font></label>
<span class="profile_meta_value"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">NoobCV</font></font></span>
</p>
<p class="profile_meta">
<label class="profile_meta_label"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">功能介紹</font></font></label>
<span class="profile_meta_value"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">哈工大在讀博士的公眾號,《OpenCV 4快速入門》的作者,面向初學者介紹計算機視覺基礎知識、OpenCV使用、SLAM技術,深度學習等內容。</font></font></span>
</p>
</div>
<span class="profile_arrow_wrp" id="js_profile_arrow_wrp">
<i class="profile_arrow arrow_out"></i>
<i class="profile_arrow arrow_in"></i>
</span>
</div>
</span>
<em id="publish_time" class="rich_media_meta rich_media_meta_text"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">2022-08-26 10:05</font></font></em>
<em id="js_ip_wording_wrp" class="rich_media_meta rich_media_meta_text" role="option" style="display: inline-block;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">發表於</font></font><span id="js_ip_wording"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">香港</font></font></span></em>
</div>
<div id="js_tags" class="article-tag__list" style="display: none;" data-len="0">
<div class="article-tag-card__title"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">收錄於合集</font></font></div>
<div class="article-tags">
</div>
</div>
<div class="original_area_primary" style="margin-bottom: 0;">
</div>
<div class="original_area_primary">
<p role="option" class="original_primary_card_tips">
<span><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">以下文章來源於Datawhale </font></font></span>
<span><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">,作者Datawhale</font></font></span>
</p>
<a class="weui-flex original_primary_card appmsg_card_context wx_tap_card js_wx_tap_highlight" href="https://mp.weixin.qq.com/s/EP0nPfgYrYTfg36iIGxM0g#" id="copyright_info">
<div class="weui-flex__hd">
<span class="radius_avatar">
<img class="avatar" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/0" alt="">
</span>
</div>
<div class="weui-flex__item" role="option">
<strong class="original_primary_nickname"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Datawhale</font></font></strong>
<span class="weui-hidden_abs"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">.</font></font></span>
<p class="original_primary_desc"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">一個專注於AI領域的開源組織,匯聚了眾多優秀學習者,願景-for the learner,和學習者一起成長。</font></font></p>
</div>
<div class="weui-flex__ft"></div>
</a>
</div>
<div class="rich_media_content autoTypeSetting24psection
" id="js_content" style="visibility: visible;"><section style="font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: rgb(255, 255, 255); text-align: center; visibility: visible;" data-mpa-powered-by="yiban.io"><section powered-by="xiumi.us" style="letter-spacing: 0.544px; visibility: visible;"><section style="letter-spacing: 0.544px; visibility: visible;"><section style="letter-spacing: 0.544px; visibility: visible;"><section style="letter-spacing: 0.544px; visibility: visible;"><section data-id="85660" data-custom="rgb(117, 117, 118)" data-color="rgb(117, 117, 118)" style="letter-spacing: 0.544px; visibility: visible;"><section style="letter-spacing: 0.544px; visibility: visible;"><section style="letter-spacing: 0.544px; visibility: visible;"><section style="letter-spacing: 0.544px; visibility: visible;"><section style="letter-spacing: 0.544px; visibility: visible;"><section style="letter-spacing: 0.544px; visibility: visible;"><section data-id="85660" data-custom="rgb(117, 117, 118)" data-color="rgb(117, 117, 118)" style="letter-spacing: 0.544px; visibility: visible;"><section style="letter-spacing: 0.544px; visibility: visible;"><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;font-size: 17px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;background-color: rgb(255, 255, 255);color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;text-align: center;visibility: visible;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;letter-spacing: 0.544px;widows: 1;color: rgb(178, 178, 178);visibility: visible;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">點擊上方</font></font></span><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;letter-spacing: 0.544px;widows: 1;color: rgb(0, 128, 255);visibility: visible;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">“</font></font><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;visibility: visible;"><strong mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 1px;visibility: visible;"><strong mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">小白學視覺</font></font></strong></span></strong></span></span><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;letter-spacing: 0.544px;widows: 1;color: rgb(178, 178, 178);visibility: visible;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">”,選擇加"</font></font></span><strong mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: rgb(62, 62, 62);letter-spacing: 0.544px;widows: 1;visibility: visible;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;color: rgb(255, 169, 0);visibility: visible;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">星標</font></font></span></strong><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;letter-spacing: 0.544px;widows: 1;color: rgb(178, 178, 178);visibility: visible;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">"或“</font></font></span><strong mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: rgb(62, 62, 62);letter-spacing: 0.544px;widows: 1;visibility: visible;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;color: rgb(255, 169, 0);visibility: visible;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">置頂</font></font></span></strong><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;letter-spacing: 0.544px;widows: 1;color: rgb(178, 178, 178);visibility: visible;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">”</font></font></span></p><pre style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 17px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;background-color: rgb(255, 255, 255);color: rgb(51, 51, 51);letter-spacing: normal;visibility: visible;"><p style="margin: 0em 1em;padding: 0px 0.5em;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;letter-spacing: 0.544px;white-space: normal;color: rgb(62, 62, 62);text-align: center;visibility: visible;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: rgb(178, 178, 178);font-size: 14px;visibility: visible;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">重磅乾貨,第一時間送達</font></font></span></p><p style="margin: 0em 1em;padding: 0px 0.5em;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;letter-spacing: 0.544px;white-space: normal;color: rgb(62, 62, 62);text-align: center;visibility: visible;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: rgb(178, 178, 178);font-size: 14px;visibility: visible;"><img class="rich_pages wxw-img" data-backh="34" data-backw="546" data-ratio="0.0625" data-s="300,640" data-src="https://mmbiz.qpic.cn/mmbiz_jpg/ow6przZuPIENb0m5iawutIf90N2Ub3dcPuP2KXHJvaR1Fv2FnicTuOy3KcHuIEJbd9lUyOibeXqW8tEhoJGL98qOw/640?wx_fmt=jpeg&wxfrom=5&wx_lazy=1&wx_co=1" data-type="jpeg" data-w="640" style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; vertical-align: bottom; color: rgb(62, 62, 62); font-size: 16px; letter-spacing: 0.544px; visibility: visible !important; box-sizing: border-box !important; overflow-wrap: break-word !important; width: 530px !important; height: auto !important;" width="100%" _width="530px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640" crossorigin="anonymous" alt="圖片" data-fail="0"></span></p></pre></section></section></section></section></section></section></section></section></section></section></section></section></section><section style="font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: rgb(255, 255, 255); visibility: visible;"><section powered-by="xiumi.us" style="visibility: visible;"><section style="letter-spacing: 0.544px; font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif; visibility: visible;"><section style="visibility: visible;"><section style="visibility: visible;"><section data-id="85660" data-custom="rgb(117, 117, 118)" data-color="rgb(117, 117, 118)" style="visibility: visible;"><section style="visibility: visible;"><section style="visibility: visible;"><section style="visibility: visible;"><section style="visibility: visible;"><section style="visibility: visible;"><section data-id="85660" data-custom="rgb(117, 117, 118)" data-color="rgb(117, 117, 118)" style="border-width: 0px; border-style: initial; border-color: currentcolor; visibility: visible;"><section style="margin-top: 2em; padding-top: 0.5em; padding-bottom: 0.5em; border-style: solid none; text-decoration: inherit; border-top-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-top-width: 1px; border-bottom-width: 1px; visibility: visible;"><section style="margin-top: -1.2em; margin-bottom: 10px; color: rgb(62, 62, 62); font-size: 16px; text-align: center; font-family: inherit; border-width: initial; border-style: initial; border-color: currentcolor; line-height: 1.75em; visibility: visible;"><span style="color: rgb(255, 255, 255); background-color: rgb(117, 117, 118); font-size: 15px; visibility: visible;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> 好文乾貨 </font></font><br style="visibility: visible;"></span></section><p style="margin-top: 5px; margin-bottom: 5px; text-align: center; line-height: 1.5em; visibility: visible;"><span style="color: rgb(136, 136, 136); font-size: 12px; visibility: visible;"><strong style="visibility: visible;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">作者:</font></font></strong><strong style="visibility: visible;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">伍天舟、</font></font></strong><strong style="visibility: visible;"><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif; visibility: visible;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">馬曾歐、</font></font></span></strong><strong style="visibility: visible;"><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif; visibility: visible;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">陳信達</font></font></span></strong></span></p></section></section></section></section></section></section></section></section></section></section></section></section></section><p style="margin-top: 15px; margin-bottom: 5px; visibility: visible;"><span style="font-size: 15px; visibility: visible;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">入門深度學習,很多人經歷了從入門到放棄的心酸歷程,且千軍萬馬倒在了入門第一道關卡:環境配置問題。</font><font style="vertical-align: inherit;">俗話說,環境配不對,學習兩行淚。</font></font></span></p><p style="margin-top: 15px; margin-bottom: 25px; visibility: visible;"><span style="font-size: 15px; visibility: visible;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">如果你正在面臨配置環境的痛苦,不管你是Windows用戶、Ubuntu用戶還是蘋果死忠粉,這篇文章都是為你量身定制的。</font><font style="vertical-align: inherit;">接下來就依次講下Windows、Mac和Ubuntu的深度學習環境配置問題。</font></font></span></p><p style="visibility: visible;"><strong style="visibility: visible;"><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif; color: rgb(171, 25, 66); font-size: 18px; visibility: visible;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">一、Windows系統深度學習環境配置</font></font></span></strong></p><section style="text-align: justify; margin-top: 10px; margin-bottom: 10px; visibility: visible;"><span style="font-size: 15px; visibility: visible;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">系統:Win10 64位操作系統</font></font></span></section><p style="text-align: justify; margin-bottom: 15px; visibility: visible;"><span style="font-size: 15px; visibility: visible;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">安裝組合:Anaconda+PyTorch(GPU版)+GTX1060</font></font></span></p><section style="text-align: justify;"><span style="font-size: 15px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">開源貢獻:伍天舟,內蒙古農業大學</font></font></span></section><h3 style="margin-top: 15px;margin-bottom: 5px;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);"><strong style="font-size: 17px;color: rgb(171, 25, 66);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">1.1 打開Anaconda Prompt</font></font></strong></h3><section style="margin-bottom: 15px;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">1、conda create -n pytorch python=3.7.0:創建名為pytorch的虛擬環境,並為該環境安裝python=3.7。</font></font></span></section><section style="margin-bottom: 10px;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">2、activate pytorch:激活名為pytorch的環境</font></font></span></section><p><img data-ratio="0.16091954022988506" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2f2aFick0ib6tPhgoUyLp3odzFciaAFQwia065usj87mme6jRjMbkRibjBtiaA/640?wx_fmt=png" data-type="png" data-w="435" _width="435px" class="" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(1)" style="width: 435px !important; height: auto !important; visibility: visible !important;" crossorigin="anonymous" alt="圖片" data-fail="0"></p><p style="margin-top: 15px;margin-bottom: 5px;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);"><strong style="font-size: 17px;color: rgb(171, 25, 66);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">1.2 確定硬件支持的CUDA版本</font></font></strong></p><p><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">NVIDIA控制面板-幫助-系統信息-組件</font></font></span><br></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-backh="543" data-backw="572" data-croporisrc="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fZgw23JOJyL2yDJubwBQVILNFiaiaBkzib4Qsibq4PbCuPzzQiaYKbKCCfKg/0?wx_fmt=png" data-cropx1="0" data-cropx2="572" data-cropy1="0" data-cropy2="520.628670120898" data-ratio="0.9090909090909091" data-s="300,640" data-src="https://mmbiz.qpic.cn/mmbiz_jpg/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2f5ZA6PfOw0I25QoykuNrjjBic0DHcLPcNoHwQNYzrQDamrOYsTj2VQ9A/640?wx_fmt=jpeg" data-type="jpeg" data-w="572" style="width: 578px !important; height: auto !important; visibility: visible !important;" _width="578px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(2)" crossorigin="anonymous" alt="圖片" data-fail="0"></p><section style="margin-top: 15px;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">2020年5月19日16:46:31,我更新了顯卡驅動,看到我的cuda支持11以內的</font></font></span></section><p style="margin-top: 15px;margin-bottom: 5px;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);"><strong style="font-size: 17px;color: rgb(171, 25, 66);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">1.3 確定pytorch版本,torchvision版本</font></font></strong></p><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">進入pytorch官網:https://pytorch.org/get-started/locally/</font></font></span></p><p><img data-backh="224" data-backw="579" data-croporisrc="https://mmbiz.qlogo.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2foFnPntKGIvehcTI2oSeqnrxPCEKmu68eiatgXkWUIu8Je0vF8iaYYb4w/0?wx_fmt=png" data-cropx1="0" data-cropx2="825" data-cropy1="0" data-cropy2="287.8238341968912" data-ratio="0.3478787878787879" data-src="https://mmbiz.qpic.cn/mmbiz_jpg/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2ficibObXdHrfaNNpEqZYeHkOichOevPbICJ3XZW0rCmsTHnkeobictlR5ug/640?wx_fmt=jpeg" data-type="jpeg" data-w="825" style="width: 578px !important; height: auto !important; visibility: visible !important;" _width="578px" class="" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(3)" crossorigin="anonymous" alt="圖片" data-fail="0"></p><p style="margin-top: 10px;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">因為官方源太慢了,這裡使用清華源下載</font></font></span></p><p style="margin-top: 15px;margin-bottom: 5px;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);"><strong style="font-size: 17px;color: rgb(171, 25, 66);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">1.4 鏡像中下載對應的安裝包</font></font></strong></p><p style="text-align: left;"><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 12px;text-align: left;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">清華鏡像:</font></font></span></p><section style="text-align: left;margin-bottom: 10px;"><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 12px;text-align: left;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/win-64/</font></font></span></section><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">pytorch:</font></font></span></p><p><img data-backh="113" data-backw="579" data-croporisrc="https://mmbiz.qlogo.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fJhVNFcCzTo2TaNkHf8vPsHY2uGEloMBYO0SqWeG9kUicZSIe1iarbaog/0?wx_fmt=png" data-cropx1="0" data-cropx2="1129" data-cropy1="0" data-cropy2="191.0915371329879" data-ratio="0.1682905225863596" data-src="https://mmbiz.qpic.cn/mmbiz_jpg/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fLWr8gkqvANlB0MfP6JS32C3fzo7oXSQZiaicTP5rL2gczjl9aViaez99Q/640?wx_fmt=jpeg" data-type="jpeg" data-w="1129" style="width: 578px !important; height: auto !important; visibility: visible !important;" _width="578px" class="" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(4)" crossorigin="anonymous" alt="圖片" data-fail="0"></p><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">torchvision:</font></font></span></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-backh="70" data-backw="578" data-croporisrc="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fX336AxGdb1m1phicjEqACgtVetGXKejP5cuq8ATM2I7gcR0jANfaMRA/0?wx_fmt=png" data-cropx1="0" data-cropx2="1050" data-cropy1="0" data-cropy2="126.94300518134716" data-ratio="0.12095238095238095" data-s="300,640" data-src="https://mmbiz.qpic.cn/mmbiz_jpg/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fWEPEQ1JgMb7palNKtD8zsOIOuTruXzr8ceABBrUfibEg66fQwhskJOA/640?wx_fmt=jpeg" data-type="jpeg" data-w="1050" style="width: 100% !important; height: auto !important; visibility: visible !important;" _width="100%" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(5)" crossorigin="anonymous" alt="圖片" data-fail="0"></p><p style="margin-top: 15px;margin-bottom: 5px;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);"><strong style="font-size: 17px;color: rgb(171, 25, 66);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">1.5 本地安裝</font></font></strong></p><section style="margin-bottom: 10px;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">接著第一步,在pytorch環境下進行安裝,依次輸入如下指令。</font></font></span></section><p style="text-align: center;"><img class="rich_pages wxw-img" data-backh="136" data-backw="579" data-ratio="0.23487903225806453" data-s="300,640" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fXNxmaIm7bLu0KyXn2LAliaSbEibgI0f6Kz1SVGxZ4SrqUR0O93wfhurA/640?wx_fmt=png" data-type="png" data-w="992" style="width: 100% !important; height: auto !important; visibility: visible !important;" _width="100%" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(6)" crossorigin="anonymous" alt="圖片" data-fail="0"></p><section style="margin-top: 15px;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;"><img data-backh="74" data-backw="579" data-ratio="0.12866108786610878" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fNlU69d9NiaJuBMKq1M9CV8vBaoNiapuorI5360xmEhTFkbfMaqRem0Vw/640?wx_fmt=png" data-type="png" data-w="956" style="width: 100% !important; height: auto !important; visibility: visible !important;" _width="100%" class="" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(7)" crossorigin="anonymous" alt="圖片" data-fail="0"></span></section><p style="margin-top: 15px;margin-bottom: 15px;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">然後回到虛擬環境所在目錄,用conda install anaconda安裝環境所需的基礎包</font></font></span><br></p><p><img data-ratio="0.10189982728842832" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fImITnnmLnNib7nYJ7I7wIricSnTZKrtP6iaWNdCTsgcCos86YibeV8XBVw/640?wx_fmt=png" data-type="png" data-w="579" _width="579px" class="" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(8)" style="width: 579px !important; height: auto !important; visibility: visible !important;" crossorigin="anonymous" alt="圖片" data-fail="0"></p><p style="margin-top: 15px;margin-bottom: 5px;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);"><strong style="font-size: 17px;color: rgb(171, 25, 66);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">1.6 測試</font></font></strong></p><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">代碼1:</font></font></span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="typescript"><code><span class="code-snippet_outer">from future import print_function</span></code><code><span class="code-snippet_outer">import torch</span></code><code><span class="code-snippet_outer">x = torch.rand(5, 3)</span></code><code><span class="code-snippet_outer">print(x)</span></code></pre></section><section style="margin-bottom: 10px;margin-top: 15px;"><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">輸出類似於以下的張量:</font></font></span></section><p style="text-align: left;"><img class="rich_pages wxw-img" data-ratio="0.22434017595307917" data-s="300,640" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fW870wTpqJgVqmYtOMXttJFiaPTcmFJEV0QytrcYKf2McD9EcJhdGnDQ/640?wx_fmt=png" data-type="png" data-w="682" style="width: 677px !important; height: auto !important; visibility: visible !important;" _width="677px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(9)" crossorigin="anonymous" alt="圖片" data-fail="0"></p><section style="margin-top: 10px;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">代碼2:</font></font></span></section><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li></ul><pre class="code-snippet__js" data-lang="css"><code><span class="code-snippet_outer">import torch</span></code><code><span class="code-snippet_outer">torch.cuda.is_available()</span></code></pre></section><section style="margin-bottom: 15px;"><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 12px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">輸出:True</font></font></span></section><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">如果以上兩段代碼輸出無異常,表明環境搭建成功。</font></font></span></p><p style="margin-top: 15px;margin-bottom: 5px;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);"><strong style="font-size: 17px;color: rgb(171, 25, 66);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">1.7 遇到的問題</font></font></strong></p><ul class="list-paddingleft-1" style="list-style-type: square;"><li style="font-weight: bold;color: rgb(171, 25, 66);"><p><span style="color: rgb(171, 25, 66);"><strong><span style="font-size: 15px;"><strong style="font-size: 17px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">用下面命令創建虛擬環境報錯</font></font></strong></span></strong></span></p></li></ul><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer">conda create -n py37_torch131 python=3.7</span></code></pre></section><p style="text-align: center;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;"><img class="rich_pages wxw-img" data-ratio="0.38923395445134573" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fAcDPWnuy7ibGHe2RwZ5S9Ey0H6D2tCUuvwoTWoH5wRljvicDZC6icyvBQ/640?wx_fmt=png" data-type="png" data-w="483" _width="483px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(10)" style="width: 483px !important; height: auto !important; visibility: visible !important;" crossorigin="anonymous" alt="圖片" data-fail="0"></span><br></p><section style="margin-top: 10px;text-align: left;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">【解決方法】https://blog.csdn.net/weixin_42329133/article/details/102640763</font></font></span></section><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">環境會保存在Anaconda目錄下的envs文件夾內</font></font></span></p><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;"><br></span></p><ul class="list-paddingleft-1" style="list-style-type: square;"><li style="font-weight: bold;color: rgb(171, 25, 66);"><p><span style="color: rgb(171, 25, 66);"><strong><span style="font-size: 15px;"><strong style="font-size: 17px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">PackagesNotFoundError: The following packages are not available from current channels</font></font></strong><br></span></strong></span></p></li></ul><p style="text-align: center;"><img class="rich_pages wxw-img" data-ratio="0.481029810298103" data-s="300,640" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fGIDNSg4kicAfaFSicYNvAGd9qUtKzBicI1U0U7sQlC35EBI8EAMGek5Qg/640?wx_fmt=png" data-type="png" data-w="738" style="width: 677px !important; height: auto !important; visibility: visible !important;" _width="677px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(11)" crossorigin="anonymous" alt="圖片" data-fail="0"></p><section style="margin-top: 10px;text-align: left;"><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">【解決方法】:</font></font></span></section><section style="text-align: left;"><span style="font-size: 12px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">https://www.cnblogs.com/hellojiaojiao/p/10790273.html</font></font></span></section><section><span style="font-size: 15px;"><br></span></section><ul class="list-paddingleft-1" style="list-style-type: square;"><li style="font-weight: bold;color: rgb(171, 25, 66);"><p><span style="color: rgb(171, 25, 66);"><strong><span style="font-size: 15px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">conda下載太慢問題</font></font></span></strong></span></p></li></ul><section style="margin-top: 10px;text-align: left;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">【解決方案】</font></font></span><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 12px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">https://mirror.tuna.tsinghua.edu.cn/help/anaconda/</font></font></span></section><p style="margin-top: 15px;"><span style="font-size: 15px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">我直呼一聲清華NB!</font></font></span></p><section><span style="font-size: 15px;"><br></span></section><ul class="list-paddingleft-1" style="list-style-type: square;"><li style="font-weight: bold;color: rgb(171, 25, 66);"><p><span style="color: rgb(171, 25, 66);"><strong><span style="font-size: 15px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">cuda安裝</font></font></span></strong></span></p></li></ul><section style="margin-bottom: 15px;text-align: left;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">cuda歷史版本下載:</font></font></span><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 12px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">https://developer.nvidia.com/cuda-toolkit-archive</font></font></span></section><section style="margin-bottom: 15px;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">要看NVIDIA的组件,自己的CUDA支持哪个版本,我是1060显卡,所以我下的10.0版本的cuda</span></section><p style="text-align: center;"><img class="rich_pages wxw-img" data-backh="323" data-backw="537" data-croporisrc="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fKmHVuTMrUIXUibq3UlrcGM1mzhUiaZXvQdtOX7meaCHjDF0HOiaag5Snw/0?wx_fmt=png" data-cropx1="0" data-cropx2="537" data-cropy1="0" data-cropy2="289.3678756476684" data-ratio="0.5381750465549349" data-s="300,640" data-src="https://mmbiz.qpic.cn/mmbiz_jpg/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fukEibKz1uVFsXTtUI0VxOAq97SWszuzzWFNlibo5LIamXCAClcEK0J0g/640?wx_fmt=jpeg" data-type="jpeg" data-w="537" style="width: 578px !important; height: auto !important; visibility: visible !important;" _width="578px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(12)" crossorigin="anonymous" alt="圖片" data-fail="0"></p><p><br></p><ul class="list-paddingleft-1" style="list-style-type: square;"><li style="font-weight: bold;color: rgb(171, 25, 66);"><p><span style="color: rgb(171, 25, 66);"><strong><span style="font-size: 15px;">pytorch安装</span></strong></span></p></li></ul><section style="margin-bottom: 10px;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">官网没有我的组合,我满脸问号</span></section><p style="text-align: center;"><img class="rich_pages wxw-img" data-backh="406" data-backw="579" data-croporisrc="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2ffhuKnCt84xYJFumlR2G3pZ2ZquC0cHZbDWSFXHfia0QngcPBrhapLVw/0?wx_fmt=png" data-cropx1="0" data-cropx2="838.0000000000001" data-cropy1="0" data-cropy2="560.1139896373056" data-ratio="0.6682577565632458" data-s="300,640" data-src="https://mmbiz.qpic.cn/mmbiz_jpg/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fbB92U0hPHHawITPnhNqFjJumXpWOcXnmWkG0X2VIz2mqPpLtBias7Eg/640?wx_fmt=jpeg" data-type="jpeg" data-w="838" style="width: 578px !important; height: auto !important; visibility: visible !important;" _width="578px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(13)" crossorigin="anonymous" alt="圖片" data-fail="0"></p><section style="margin-top: 10px;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">这里我直接(别忘了先进入刚创建的环境)</span></section><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer">conda install pytorch torchvision cudatoolkit=10.0 -c pytorch</span></code></pre></section><p><br></p><ul class="list-paddingleft-1" style="list-style-type: square;"><li style="font-weight: bold;color: rgb(171, 25, 66);"><section><span style="color: rgb(171, 25, 66);"><strong><span style="font-size: 15px;">jupyter note如何进入虚拟环境</span></strong></span></section></li></ul><section data-mpa-template="t" mpa-from-tpl="t"><section label="powered by 135editor.com" style="white-space: normal;max-width: 100%;font-family: 微软雅黑;background-color: rgb(255, 255, 255);box-sizing: border-box !important;overflow-wrap: break-word !important;" mpa-from-tpl="t"><section style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;" mpa-from-tpl="t"><section style="padding: 10px;max-width: 100%;border-width: 1px;border-style: solid;border-color: rgb(240, 242, 246);font-family: inherit;text-decoration: inherit;background-color: rgb(240, 242, 246);box-sizing: border-box !important;overflow-wrap: break-word !important;" mpa-from-tpl="t"><p style="margin: 5px 16px;color: rgb(62, 62, 62);line-height: 25.6px;max-width: 100%;min-height: 1em;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="color: rgb(136, 136, 136);font-family: inherit;font-size: 14px;text-decoration: inherit;">python -m ipykernel install --name 虚拟环境名</span><br></p><p style="margin: 5px 16px;color: rgb(62, 62, 62);line-height: 25.6px;max-width: 100%;min-height: 1em;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="color: rgb(136, 136, 136);font-family: inherit;font-size: 14px;text-decoration: inherit;">1.打开Anaconda Prompt,输入conda env list 查看现有环境</span></p><p style="margin: 5px 16px;color: rgb(62, 62, 62);line-height: 25.6px;max-width: 100%;min-height: 1em;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="color: rgb(136, 136, 136);font-family: inherit;font-size: 14px;text-decoration: inherit;">2.输入activate name(name是你想切换的环境)</span></p><p style="margin: 5px 16px;color: rgb(62, 62, 62);line-height: 25.6px;max-width: 100%;min-height: 1em;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="color: rgb(136, 136, 136);font-family: inherit;font-size: 14px;text-decoration: inherit;">3.conda install ipykernel 安装必要插件</span></p><p style="margin: 5px 16px;color: rgb(62, 62, 62);line-height: 25.6px;max-width: 100%;min-height: 1em;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="color: rgb(136, 136, 136);font-family: inherit;font-size: 14px;text-decoration: inherit;">4.python -m ipykernel install --name Name 将环境添加到Jyputer中(Name是此环境显示在Jyputer中的名称,可自定义)</span></p></section></section></section></section><p><br></p><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">删除内核</span></p><section data-mpa-template="t" mpa-from-tpl="t"><section label="powered by 135editor.com" style="white-space: normal;max-width: 100%;font-family: 微软雅黑;background-color: rgb(255, 255, 255);box-sizing: border-box !important;overflow-wrap: break-word !important;" mpa-from-tpl="t"><section style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;" mpa-from-tpl="t"><section style="padding: 10px;max-width: 100%;border-width: 1px;border-style: solid;border-color: rgb(240, 242, 246);font-family: inherit;text-decoration: inherit;background-color: rgb(240, 242, 246);box-sizing: border-box !important;overflow-wrap: break-word !important;" mpa-from-tpl="t"><p style="margin: 5px 16px;color: rgb(62, 62, 62);line-height: 25.6px;max-width: 100%;min-height: 1em;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;font-size: 14px;line-height: 26.25px;color: rgb(136, 136, 136);box-sizing: border-box !important;overflow-wrap: break-word !important;">jupyter kernelspec remove 内核名称</span></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-croporisrc="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fFdNMAWUwkeq4ibdexcIMkZpy0r0IE4WRlJSKe8FWRkff8T2tKmvOgnA/0?wx_fmt=png" data-cropx1="0" data-cropx2="661" data-cropy1="0" data-cropy2="492.18345323741005" data-ratio="0.7443267776096822" data-s="300,640" data-src="https://mmbiz.qpic.cn/mmbiz_jpg/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fV4QhicwtmhOr0BXZLNRhu7RukWo61a1rFbmxiaGicv14Fb5E6XicaH5Nibg/640?wx_fmt=jpeg" data-type="jpeg" data-w="661" style="width: 556px !important; height: auto !important; visibility: visible !important;" _width="556px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(14)" crossorigin="anonymous" alt="圖片" data-fail="0"></p></section></section></section></section><p><br mpa-from-tpl="t"></p><section style="margin-bottom: 10px;"><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;">报错[Errono 13]</span></section><section data-mpa-template="t" mpa-from-tpl="t"><section label="powered by 135editor.com" style="white-space: normal;max-width: 100%;font-family: 微软雅黑;background-color: rgb(255, 255, 255);box-sizing: border-box !important;overflow-wrap: break-word !important;" mpa-from-tpl="t"><section style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;" mpa-from-tpl="t"><section style="padding: 10px;max-width: 100%;border-width: 1px;border-style: solid;border-color: rgb(240, 242, 246);font-family: inherit;text-decoration: inherit;background-color: rgb(240, 242, 246);box-sizing: border-box !important;overflow-wrap: break-word !important;" mpa-from-tpl="t"><p style="margin: 5px 16px;color: rgb(62, 62, 62);line-height: 25.6px;max-width: 100%;min-height: 1em;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;font-size: 14px;line-height: 26.25px;color: rgb(136, 136, 136);box-sizing: border-box !important;word-wrap: break-word !important;" mpa-is-content="t"><strong style="max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;" mpa-from-tpl="t"></strong>[Errno 13] Permission denied: ‘/usr/local/share/jupyter’</span></p></section></section></section></section><section style="margin-top: 15px;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">为此,需要添加–user选项,将配置文件生成在本账户的家目录下。</span></section><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="sql"><code><span class="code-snippet_outer">python -m ipykernel install --user --name py27-caffe-notebook</span></code></pre></section><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">至此,添加kernel完成。</span><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;">查看已有的kernel:</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="cpp"><code><span class="code-snippet_outer">jupyter kernelspec list</span></code></pre></section><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">删除已有的kernel</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="cs"><code><span class="code-snippet_outer">jupyter kernelspec remove kernelname</span></code></pre></section><p><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;">以上的命令删除仅仅是配置文件,并没有卸载相应虚拟环境的ipykernel,因此若要再次安装相应python虚拟环境的kernel,只需激活虚拟环境,然后</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="sql"><code><span class="code-snippet_outer">python -m ipykernel install --name kernelname</span></code></pre></section><ul class="list-paddingleft-1" style="list-style-type: square;"><li><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">conda安装一半总失败</span></p></li></ul><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">把文件下载到本地,进入该文件的目录,然后用命令</span><br></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="sql"><code><span class="code-snippet_outer">conda install --offline 包名</span></code></pre></section><section style="margin-top: 10px;"><span style="font-size: 15px;"><br></span></section><section><strong><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;color: rgb(171, 25, 66);font-size: 18px;">二、Mac深度学习环境配置</span></strong><br></section><section style="margin-bottom: 10px;margin-top: 10px;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">安装组合:Anaconda+PyTorch(GPU版)</span></section><section style="margin-bottom: 10px;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">开源贡献:马曾欧,伦敦大学</span></section><p style="margin-top: 15px;margin-bottom: 5px;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);"><strong style="font-size: 17px;color: rgb(171, 25, 66);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;">2.1 安装Anaconda</strong></p><section style="margin-bottom: 10px;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">Anaconda 的安装有两种方式,这里仅介绍一种最直观的- macOS graphical </span><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;">install。</span></section><section style="margin-bottom: 10px;"><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;">https://www.anaconda.com/products/individual里,Anaconda Installers的位置,选择Python 3.7 下方的“64-Bit Graphical Installer (442)”。下载好</span></section><p style="text-align: center;"><img class="rich_pages wxw-img" data-ratio="0.57578125" data-s="300,640" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fqB2PlsOmDmkv4bJ6Yhnhqic0VjKWTlN7z9eUeAx211WhOgzhOqZ9kUA/640?wx_fmt=png" data-type="png" data-w="1280" style="width: 677px !important; height: auto !important; visibility: visible !important;" _width="677px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(15)" crossorigin="anonymous" alt="圖片" data-fail="0"></p><section style="margin-top: 15px;text-align: left;"><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;">pkg 安装包后点击进入,按下一步完成安装即可。默认安装地点为~/opt。想用command line install 的,请自行参考:https://docs.anaconda.com/anaconda/install/mac-os/</span></section><p style="margin-top: 15px;margin-bottom: 5px;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);"><strong style="font-size: 17px;color: rgb(171, 25, 66);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;">2.2 确认下载情况</strong></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-ratio="0.12514757969303425" data-s="300,640" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fKOk66rtnv6CtGhfOx4Yq9rxz3Yjune8a0hrcZxZS2URWoq0icecjs3A/640?wx_fmt=other" data-type="other" data-w="847" style="width: 677px !important; height: auto !important; visibility: visible !important;" _width="677px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(16)" crossorigin="anonymous" alt="圖片" data-fail="0"></p><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">在Mac 的Terminal 里,输入</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer">python --version</span></code></pre></section><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">确保安装的Python 是3.x 版本。</span><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;">在Terminal 输入</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer">jupyter notebook</span></code></pre></section><section style="margin-bottom: 10px;"><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;">弹出网页,即可进入notebook。</span><br></section><p style="text-align: center;"><img class="rich_pages wxw-img" data-backh="362" data-backw="579" data-ratio="0.6267942583732058" data-s="300,640" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fxJLkz3RN745Yibj0eTDzyicVvjSHrZPNxFZicUnxNkvMDHIQM2AzzWvKA/640?wx_fmt=png" data-type="png" data-w="836" style="width: 100% !important; height: auto !important; visibility: visible !important;" _width="100%" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(17)" crossorigin="anonymous" alt="圖片" data-fail="0"></p><section style="margin-top: 10px;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">在网页右上角点击Quit,或返回Terminal,command + c,退出notebook。</span></section><p style="text-align: center;"><img class="rich_pages wxw-img" data-backh="97" data-backw="579" data-ratio="0.1680473372781065" data-s="300,640" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fuiauJicicbOv9lKXricgOmPpRDic0pUNib3icrJgU83efZDTeg5GrYV2vLd9w/640?wx_fmt=png" data-type="png" data-w="845" style="width: 100% !important; height: auto !important; visibility: visible !important;" _width="100%" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(18)" crossorigin="anonymous" alt="圖片" data-fail="0"></p><p style="margin-bottom: 5px;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);margin-top: 15px;"><span style="font-size: 15px;"><strong style="font-size: 17px;color: rgb(171, 25, 66);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;">2.2.1 常见问题</strong></span></p><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">如果电脑中下载了多个Anaconda,运行时可能出现冲突。在Terminal 中输入</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="bash"><code><span class="code-snippet_outer">cd ~</span></code></pre></section><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">返回home 目录,输入</span><br></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="css"><code><span class="code-snippet_outer">cat .bash_profile</span></code></pre></section><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">如果只能看到一个Anaconda 版本就没有问题。如果有多个则下载包时有可能</span><br></p><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">造成一定的冲突。用vim、nano 或其他文本编辑器把旧版本Anaconda 的</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="javascript"><code><span class="code-snippet_outer">export PATH= ...</span></code></pre></section><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">删除。</span></p><p style="margin-top: 15px;margin-bottom: 5px;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);"><strong style="font-size: 17px;color: rgb(171, 25, 66);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;">2.3 虚拟环境和包的下载</strong></p><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">用conda 去创建虚拟环境和下载对应的包是很简单的一件事。</span></p><p style="margin-bottom: 5px;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);margin-top: 15px;"><span style="font-size: 15px;"><strong style="font-size: 17px;color: rgb(171, 25, 66);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;">2.3.1 Graphic</strong></span></p><section style="margin-bottom: 10px;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">点击Anaconda-Navigator,可以看到自己下载好的应用程序,左上角“Applications on”应该指向的是“base (root)”,左边点击“Environments”就可以看</span><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;">到自己建立的虚拟环境和对应的包了。点击左下角的Create 即可创建一个新的虚拟环境。</span></section><p style="text-align: center;"><img class="rich_pages wxw-img" data-backh="227" data-backw="579" data-ratio="0.39177750906892383" data-s="300,640" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2f5QNMcAadtwcw9G2GuMcdAQRXuwthlg6rk2pRHx7NT6cOL3CUdUa63g/640?wx_fmt=png" data-type="png" data-w="827" style="width: 100% !important; height: auto !important; visibility: visible !important;" _width="100%" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(19)" crossorigin="anonymous" alt="圖片" data-fail="0"></p><section style="margin-top: 10px;"><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;">输入环境名称和python 的版本,点击create 进行创建。</span></section><p style="text-align: center;"><img class="rich_pages wxw-img" data-backh="309" data-backw="579" data-ratio="0.5342624854819977" data-s="300,640" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fiaQVibwteEBwzCZesHTFjlACfeVTvkibAGGx4tXT9SuNo5Liau4iaMiaWMIA/640?wx_fmt=png" data-type="png" data-w="861" style="width: 100% !important; height: auto !important; visibility: visible !important;" _width="100%" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(20)" crossorigin="anonymous" alt="圖片" data-fail="0"></p><p style="margin-top: 10px;margin-bottom: 15px;"><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;">之后在Home 页面,确保左上角指向的是你刚刚创建的环境名,在这个环境下install jupyter notebook,注意原本装的notebook 是在base 里的,不可通用。</span></p><p style="margin-top: 10px;margin-bottom: 10px;"><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;">回到Environments 中,可以看到在此环境中的所有包,左上方选择All,然后输入想要下载的包名</span></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-backh="499" data-backw="579" data-ratio="0.8632286995515696" data-s="300,640" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2f0SXW9eFwalLD8sCcsd1qkKf7kaWC0G5DcibZADnq0ibt9oRIicibicCDrYw/640?wx_fmt=png" data-type="png" data-w="892" style="width: 100% !important; height: auto !important; visibility: visible !important;" _width="100%" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(21)" crossorigin="anonymous" alt="圖片" data-fail="0"></p><p><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;">然后选中进行下载</span></p><p style="text-align: center;"><img class="rich_pages wxw-img" data-ratio="0.8134991119005328" data-s="300,640" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fpBBwSCTUyZBjKqAN6WT2sSsKFJRnsTDzkDMSBRDuWNbvM8ibroOkDYg/640?wx_fmt=png" data-type="png" data-w="563" style="width: 402px !important; height: auto !important; visibility: visible !important;" _width="402px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(22)" crossorigin="anonymous" alt="圖片" data-fail="0"></p><p style="margin-bottom: 5px;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);margin-top: 15px;"><span style="font-size: 15px;"><strong style="font-size: 17px;color: rgb(171, 25, 66);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;">2.3.2 Command Line</strong></span></p><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">用command line 完成以上的操作也很简洁。这次以Pytorch 为例。</span><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;">在Terminal 中输入</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="sql"><code><span class="code-snippet_outer">conda create --name env_name</span></code></pre></section><p><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;">就可以创建一个虚拟环境,叫“env_name”。输入</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="cpp"><code><span class="code-snippet_outer">conda env list</span></code></pre></section><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">即可看到创建了的所有虚拟环境,其中打* 的就是当前环境。</span><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;">输入</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer">conda activate env_name</span></code></pre></section><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">进入环境</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer">conda deactivate</span></code></pre></section><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">退出当前虚拟环境,进入base。</span></p><p style="margin-bottom: 5px;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);margin-top: 15px;"><span style="font-size: 15px;"><strong style="font-size: 17px;color: rgb(171, 25, 66);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;">2.3.3 下载Pytorch</strong></span></p><section style="margin-bottom: 10px;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">一般情况下Mac 是不支持CUDA 的。进入https://pytorch.org/ 可以看到</span></section><p style="text-align: center;"><img class="rich_pages wxw-img" data-ratio="0.7328519855595668" data-s="300,640" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fbEicx48IfCjgILJhcJlbRg4sIjf0C4c2DTzaH4XPoiaQmVtgUNOChOPA/640?wx_fmt=png" data-type="png" data-w="831" style="width: 677px !important; height: auto !important; visibility: visible !important;" _width="677px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(23)" crossorigin="anonymous" alt="圖片" data-fail="0"></p><section style="margin-top: 10px;"><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;">pytorch 官网显示当前设备应该用的下载语句。此情况,我的是</span></section><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer">conda install pytorch torchvision -c pytorch</span></code></pre></section><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">复制下来,粘贴到Terminal 中运行就可以开始下载了。</span></p><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">下载完成后,在Terminal 输入</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js"><code><span class="code-snippet_outer">python3</span></code></pre></section><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">之后import 两个刚下载的包,确认下载完成</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="swift"><code><span class="code-snippet_outer">import torch</span></code><code><span class="code-snippet_outer">import torchvision</span></code><code><span class="code-snippet_outer"><br></span></code><code><span class="code-snippet_outer">print(torch.__version__)</span></code><code><span class="code-snippet_outer">print(torchvision.__version__)</span></code></pre></section><section style="margin-bottom: 10px;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">如果import 和输出正常,配置就完成了!输入</span></section><p style="text-align: center;"><img class="rich_pages wxw-img" data-ratio="0.3182359952324195" data-s="300,640" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fBiaib23VtW02rrf0UVEsQo3HmLqrPiajGbcPrK1eKGn5qp6DUicDEe12YA/640?wx_fmt=png" data-type="png" data-w="839" style="width: 677px !important; height: auto !important; visibility: visible !important;" _width="677px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(24)" crossorigin="anonymous" alt="圖片" data-fail="0"></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js"><code><span class="code-snippet_outer">quit()</span></code></pre></section><p><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">就ok 了。</span><br></p><p style="margin-top: 15px;margin-bottom: 5px;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);"><strong style="font-size: 17px;color: rgb(171, 25, 66);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;">2.4 额外情况</strong></p><section style="margin-bottom: 15px;text-align: left;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">国内如果直接用conda 下载,可能会很慢。可以换下载源进行加速。换源方法</span><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;">可参考下列资料中的<span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-align: left;">Linux 部分</span>:https://zhuanlan.zhihu.com/p/87123943。</span></section><section style="margin-bottom: 15px;"><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;">conda 下载中常会出现“Solving environment: failed...”的问题,如果正常创建虚拟环境,这位问题应该就是没有问题的,如果还发生,可以再创建一个虚拟环境。</span></section><section style="margin-bottom: 25px;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">conda 的社群很大,基本上遇到的问题很有可能有人遇到、有人解答,Google</span><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;">会是一个很好的解决办法。</span></section><section style="white-space: normal;"><strong><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;color: rgb(171, 25, 66);font-size: 18px;">三、Ubuntu深度学习环境配置</span></strong></section><section style="margin-top: 10px;margin-bottom: 10px;white-space: normal;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">安装组合:Anaconda+PyTorch(CPU版)或<span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">PyTorch(GPU版)</span></span></section><section style="margin-bottom: 10px;white-space: normal;"><span style="font-size: 15px;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;">开源贡献:陈信达,华北电力大学</span></section><section style="margin-top: 15px;margin-bottom: 5px;white-space: normal;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;background-color: rgb(255, 255, 255);"><strong style="color: rgb(171, 25, 66);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;">3.1 Anacond安装</strong></section><section style="margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;">Anaconda和Python版本是对应的,所以需要选择安装对应Python2.7版本的还是Python3.7版本或其他版本的,根据自己的需要下载合适的安装包。</span></section><section style="margin-bottom: 10px;white-space: normal;text-align: left;"><span style="font-size: 15px;">下载链接:</span><span style="font-size: 12px;">https://www.anaconda.com/download/#linux</span></section><p cid="n28" mdtype="paragraph" style="white-space: normal;"><span style="font-size: 15px;">点击下面的64-Bit (x86) Installer (522 MB),下载64位的版本。</span></p><p cid="n28" mdtype="paragraph" style="white-space: normal;"><span style="font-size: 15px;min-width: 10px;min-height: 10px;word-break: break-all;font-family: monospace;vertical-align: top;text-align: center;"><img class="rich_pages wxw-img" data-croporisrc="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fWpFlREUGnFOBKR6rYVoPIIgUImebfxtAshJNG1t6fUl6IHlGtgM4kA/640?wx_fmt=png" data-cropx1="0" data-cropx2="1080" data-cropy1="0" data-cropy2="553.2167832167833" data-ratio="0.5111111111111111" data-src="https://mmbiz.qpic.cn/mmbiz_jpg/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fUjOia81NjbE4AObd6cCP7HRd1dg6VdKdKtg6dAgLu6HyEicrOFpCstbA/640?wx_fmt=jpeg" data-type="jpeg" data-w="1080" style="box-sizing: border-box; border-width: 0px 4px 0px 2px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: transparent; border-bottom-color: initial; border-left-color: transparent; vertical-align: middle; cursor: default; width: 572px !important; height: auto !important; visibility: visible !important;" _width="572px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(25)" crossorigin="anonymous" alt="圖片" data-fail="0"></span></p><p style="margin-top: 15px;margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;">下载完后的文件名是:Anaconda3-2020.02-Linux-x86_64.sh。</span></p><p style="margin-top: 15px;margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;">cd到Anaconda3-2020.02-Linux-x86_64.sh所在的目录:</span></p><p cid="n31" mdtype="paragraph" style="white-space: normal;text-align: left;"><span style="min-width: 10px;min-height: 10px;word-break: break-all;font-family: monospace;vertical-align: top;text-align: center;font-size: 15px;"><img data-ratio="0.08018867924528301" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fHSCOI0tn1taIlanI9IlocC7YfEYT3K4AydPTOn2TN6Xwbnb2O7ibxaw/640?wx_fmt=png" data-type="png" data-w="424" style="box-sizing: border-box; border-width: 0px 4px 0px 2px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: transparent; border-bottom-color: initial; border-left-color: transparent; vertical-align: middle; cursor: default; width: 424px !important; height: auto !important; visibility: visible !important;" _width="424px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(26)" crossorigin="anonymous" alt="圖片" data-fail="0"></span></p><section style="margin-top: 15px;white-space: normal;"><span style="font-size: 15px;">执行bash Anaconda3-2020.02-Linux-x86_64.sh开始安装:</span></section><section style="margin-top: 15px;white-space: normal;"><span style="font-size: 15px;min-width: 10px;min-height: 10px;word-break: break-all;font-family: monospace;vertical-align: top;text-align: center;"><img class="rich_pages wxw-img" data-ratio="0.2136986301369863" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fo3F5SvjkR8AF5ANfvcGXgEddSUNIwBeIHJKGQRshARBHXJt8tRSvLQ/640?wx_fmt=png" data-type="png" data-w="730" style="box-sizing: border-box; border-width: 0px 4px 0px 2px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: transparent; border-bottom-color: initial; border-left-color: transparent; vertical-align: middle; cursor: default; width: 677px !important; height: auto !important; visibility: visible !important;" _width="677px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(27)" crossorigin="anonymous" alt="圖片" data-fail="0"></span></section><section style="margin-top: 15px;white-space: normal;"><span style="font-size: 15px;">一直按回车直到如下界面,然后输入yes:</span></section><section style="margin-top: 15px;white-space: normal;"><span style="font-size: 15px;min-width: 10px;min-height: 10px;word-break: break-all;font-family: monospace;vertical-align: top;text-align: center;"><img class="rich_pages wxw-img" data-ratio="0.23633879781420766" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fqweNblBIm08xAzLxQAjPnVf7nQmG7ga2slUJUq5zJLLFApfEdyE9icg/640?wx_fmt=png" data-type="png" data-w="732" style="box-sizing: border-box; border-width: 0px 4px 0px 2px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: transparent; border-bottom-color: initial; border-left-color: transparent; vertical-align: middle; cursor: default; width: 677px !important; height: auto !important; visibility: visible !important;" _width="677px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(28)" crossorigin="anonymous" alt="圖片" data-fail="0"></span></section><section style="margin-top: 15px;white-space: normal;"><span style="font-size: 15px;">这里直接回车安装到默认路径,或者在>>>后输入自定义路径</span></section><section style="margin-top: 15px;white-space: normal;"><span style="font-size: 15px;min-width: 10px;min-height: 10px;word-break: break-all;font-family: monospace;vertical-align: top;text-align: center;"><img data-ratio="0.2938689217758985" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2foCN2cAluJqnfwekW1Ua8Xqwl9J1YPvSzeicdN1a5lgU91LS4AYXqYhA/640?wx_fmt=png" data-type="png" data-w="473" style="box-sizing: border-box; border-width: 0px 4px 0px 2px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: transparent; border-bottom-color: initial; border-left-color: transparent; vertical-align: middle; cursor: default; width: 473px !important; height: auto !important; visibility: visible !important;" _width="473px" class="" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(29)" crossorigin="anonymous" alt="圖片" data-fail="0"></span></section><section style="margin-top: 15px;white-space: normal;"><span style="font-size: 15px;">等待安装进度条走完,然后出现下面的提示,yes是加入环境变量,no是不加入环境变量,这里我们以输入no为例</span></section><section style="margin-top: 15px;white-space: normal;"><span style="font-size: 15px;min-width: 10px;min-height: 10px;word-break: break-all;font-family: monospace;vertical-align: top;text-align: center;"><img class="rich_pages wxw-img" data-ratio="0.11920529801324503" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fMvn2AZaQt7Zrnve9gCzwGTvPydPInclO3zN65iaiaAQOvmsAChzs2v5Q/640?wx_fmt=png" data-type="png" data-w="453" style="box-sizing: border-box; border-width: 0px 4px 0px 2px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: transparent; border-bottom-color: initial; border-left-color: transparent; vertical-align: middle; cursor: default; width: 453px !important; height: auto !important; visibility: visible !important;" _width="453px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(30)" crossorigin="anonymous" alt="圖片" data-fail="0"></span></section><p style="margin-top: 15px;margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;">接下来手动加入环境变量,先cd到~,然后编辑.bashrc文件:sudo vim .bashrc</span></p><p cid="n32" mdtype="paragraph" style="white-space: normal;"><span style="min-width: 10px;min-height: 10px;word-break: break-all;font-family: monospace;vertical-align: top;text-align: center;font-size: 15px;"><img class="rich_pages wxw-img" data-ratio="0.06896551724137931" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fm3XHEuEzTYTy0pIGREJLYv2I53bVCBiaQNL64PicZ3rn9KsfsSQhLZiaA/640?wx_fmt=png" data-type="png" data-w="522" style="box-sizing: border-box; border-width: 0px 4px 0px 2px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: transparent; border-bottom-color: initial; border-left-color: transparent; vertical-align: middle; cursor: default; width: 522px !important; height: auto !important; visibility: visible !important;" _width="522px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(31)" crossorigin="anonymous" alt="圖片" data-fail="0"></span></p><section style="margin-top: 15px;white-space: normal;"><span style="font-size: 15px;">在最下面添加如下几行(注意.后有空格):</span></section><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="bash"><code><span class="code-snippet_outer"># 区分anaconda python与系统内置python</span></code><code><span class="code-snippet_outer">alias python3="/usr/bin/python3.5"</span></code><code><span class="code-snippet_outer">alias python2="/usr/bin/python2.7"</span></code><code><span class="code-snippet_outer"><br></span></code><code><span class="code-snippet_outer">. /home/cxd/anaconda3/etc/profile.d/conda.sh</span></code></pre></section><section style="margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;">然后按esc + : + wq!保存</span></section><p cid="n35" mdtype="paragraph" style="white-space: normal;"><span style="font-size: 15px;min-width: 10px;min-height: 10px;word-break: break-all;font-family: monospace;vertical-align: top;text-align: center;"><img class="rich_pages wxw-img" data-ratio="0.26953125" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fZ3SlNw02GUbMibm7CGiaqics05aqIa8HoVS6IuwuFPO5vCsMamBaH19mg/640?wx_fmt=png" data-type="png" data-w="512" style="box-sizing: border-box; border-width: 0px 4px 0px 2px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: transparent; border-bottom-color: initial; border-left-color: transparent; vertical-align: middle; cursor: default; width: 512px !important; height: auto !important; visibility: visible !important;" _width="512px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(32)" crossorigin="anonymous" alt="圖片" data-fail="0"></span></p><p style="margin-top: 15px;margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;">输入source .bashrc来执行刚修改的初始化文档</span></p><section style="margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;min-width: 10px;min-height: 10px;word-break: break-all;font-family: monospace;vertical-align: top;text-align: center;"><img data-ratio="0.03805496828752643" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fs4TYgDPu2jcKk9OypNtcxZSdWn7h0nD1SAickh5o7VbVg6d3czIdicKQ/640?wx_fmt=png" data-type="png" data-w="473" style="box-sizing: border-box; border-width: 0px 4px 0px 2px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: transparent; border-bottom-color: initial; border-left-color: transparent; vertical-align: middle; cursor: default; width: 473px !important; height: auto !important; visibility: visible !important;" _width="473px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(33)" crossorigin="anonymous" alt="圖片" data-fail="0"></span></section><section style="margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;">下面输入conda env list来试试环境变量是否设置成功:</span></section><section style="margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;min-width: 10px;min-height: 10px;word-break: break-all;font-family: monospace;vertical-align: top;text-align: center;"><img class="rich_pages wxw-img" data-ratio="0.18524871355060035" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2f0zS2p0Zxicwv0DhQwpfxVZV1axVEEzLmEWLRABlxIXIhOX7jQHV7fbg/640?wx_fmt=png" data-type="png" data-w="583" style="box-sizing: border-box; border-width: 0px 4px 0px 2px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: transparent; border-bottom-color: initial; border-left-color: transparent; vertical-align: middle; cursor: default; width: 583px !important; height: auto !important; visibility: visible !important;" _width="583px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(34)" crossorigin="anonymous" alt="圖片" data-fail="0"></span></section><section style="margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;">试试刚刚设置的使用内置python的命令:python2、python3</span></section><section style="margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;min-width: 10px;min-height: 10px;word-break: break-all;font-family: monospace;vertical-align: top;text-align: center;"><img data-ratio="0.26275115919629055" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fUcZqevh4w4TJ0c13IOOibLuxwezSGXQm2RZWISsyVjmOV0b8aL2uKyw/640?wx_fmt=png" data-type="png" data-w="647" style="box-sizing: border-box; border-width: 0px 4px 0px 2px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: transparent; border-bottom-color: initial; border-left-color: transparent; vertical-align: middle; cursor: default; width: 647px !important; height: auto !important; visibility: visible !important;" _width="647px" class="" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(35)" crossorigin="anonymous" alt="圖片" data-fail="0"></span></section><section style="margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;">如果到这就结束的话,大家安装包的时候肯定会无比煎熬~这里需要将anaconda换一下源(加入清华源):</span></section><section style="margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;min-width: 10px;min-height: 10px;word-break: break-all;font-family: monospace;vertical-align: top;text-align: center;"><img data-ratio="0.2369146005509642" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fPYNWX2pP6QUuHocpI6jjmiax4FicUmrcJvGoJ4XXv6bYVicuPuJMTNDibg/640?wx_fmt=png" data-type="png" data-w="726" style="box-sizing: border-box; border-width: 0px 4px 0px 2px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: transparent; border-bottom-color: initial; border-left-color: transparent; vertical-align: middle; cursor: default; width: 677px !important; height: auto !important; visibility: visible !important;" _width="677px" class="" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(36)" crossorigin="anonymous" alt="圖片" data-fail="0"></span></section><section style="margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;">然后我们创建一个名为pytorch的虚拟环境,发现报了下面的错误:</span></section><section style="margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;min-width: 10px;min-height: 10px;word-break: break-all;font-family: monospace;vertical-align: top;text-align: center;"><img data-ratio="0.2552011095700416" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fDYaWmicHibiara8cKs5euxibicd0v3icGM3resVsxgGKcQXSphR2NNU2lcOA/640?wx_fmt=png" data-type="png" data-w="721" style="box-sizing: border-box; border-width: 0px 4px 0px 2px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: transparent; border-bottom-color: initial; border-left-color: transparent; vertical-align: middle; cursor: default; width: 677px !important; height: auto !important; visibility: visible !important;" _width="677px" class="" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(37)" crossorigin="anonymous" alt="圖片" data-fail="0"></span></section><section style="margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;">原因是我们没有清除上次安装留下来的源,输入sudo vim .condarc,修改该文件的内容(记得删除default那行):</span></section><section style="margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;min-width: 10px;min-height: 10px;word-break: break-all;font-family: monospace;vertical-align: top;text-align: center;"><img class="rich_pages wxw-img" data-ratio="0.13742690058479531" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fIxicz8Om2Fzc14Nlic5w9OsAicRRcicsibVvSYhHLEw7SQxRApY5bbaKicDg/640?wx_fmt=png" data-type="png" data-w="684" style="box-sizing: border-box; border-width: 0px 4px 0px 2px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: transparent; border-bottom-color: initial; border-left-color: transparent; vertical-align: middle; cursor: default; width: 677px !important; height: auto !important; visibility: visible !important;" _width="677px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(38)" crossorigin="anonymous" alt="圖片" data-fail="0"></span></section><section style="margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;">然后输入source .condarc,再次创建虚拟环境:</span></section><section style="margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;min-width: 10px;min-height: 10px;word-break: break-all;font-family: monospace;vertical-align: top;text-align: center;"><img class="rich_pages wxw-img" data-ratio="0.5339233038348082" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fmrGmOicwRn5kaGrXwqPlGXhPTRfMYTnPpL2lvd86uGXp2LfEQavpyPQ/640?wx_fmt=png" data-type="png" data-w="678" style="box-sizing: border-box; border-width: 0px 4px 0px 2px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: transparent; border-bottom-color: initial; border-left-color: transparent; vertical-align: middle; cursor: default; width: 677px !important; height: auto !important; visibility: visible !important;" _width="677px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(39)" crossorigin="anonymous" alt="圖片" data-fail="0"></span></section><h2 cid="n37" mdtype="heading" style="margin-top: 15px;margin-bottom: 5px;white-space: normal;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;background-color: rgb(255, 255, 255);"><strong style="font-size: 17px;color: rgb(171, 25, 66);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;">3.2 pytorch cpu版本安装</strong></h2><p style="margin-top: 15px;margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;">打开pytorch官网:https://pytorch.org/</span></p><section style="margin-bottom: 15px;white-space: normal;"><span style="min-width: 10px;min-height: 10px;word-break: break-all;font-family: monospace;vertical-align: top;text-align: center;font-size: 15px;"><img class="rich_pages wxw-img" data-backh="236" data-backw="572.0162" data-ratio="0.4131455399061033" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2faiaz8wQAFLUBicxp7oZ3bo7dnlqJwQiady5nvw4lGhsZiciba7YubQnElcg/640?wx_fmt=png" data-type="png" data-w="852" style="box-sizing: border-box; border-width: 0px 4px 0px 2px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: transparent; border-bottom-color: initial; border-left-color: transparent; vertical-align: middle; cursor: default; width: 578.171px !important; height: auto !important; visibility: visible !important;" _width="578.171px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(40)" crossorigin="anonymous" alt="圖片" data-fail="0"></span></section><section style="margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;">激活刚刚创建的虚拟环境:conda activate pytorch在安装之前先添加下面这个源:</span></section><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="cs"><code><span class="code-snippet_outer">conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch</span></code></pre></section><section style="margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;">然后输入下面代码:</span></section><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer">conda install pytorch torchvision cpuonly -c pytorch</span></code></pre></section><p cid="n40" mdtype="paragraph" style="white-space: normal;"><span style="min-width: 10px;min-height: 10px;word-break: break-all;font-family: monospace;vertical-align: top;text-align: center;display: inline-block;width: 800px;font-size: 15px;"><img class="rich_pages wxw-img" data-ratio="0.5102040816326531" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fy2zLrLl3EWicAKR3Om2cPRJAjMXR4nad8tG21DPEg5ZAtq78Y4icDOXw/640?wx_fmt=png" data-type="png" data-w="735" style="box-sizing: border-box; border-width: 0px 4px 0px 2px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: transparent; border-bottom-color: initial; border-left-color: transparent; vertical-align: middle; cursor: default; width: 677px !important; height: auto !important; visibility: visible !important;" _width="677px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(41)" crossorigin="anonymous" alt="圖片" data-fail="0"></span></p><section style="margin-top: 15px;white-space: normal;"><span style="font-size: 15px;">等到安装好后测试一下是否安装完成:</span></section><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li></ul><pre class="code-snippet__js" data-lang="swift"><code><span class="code-snippet_outer">import torch</span></code><code><span class="code-snippet_outer">print(torch.__version__)</span></code></pre></section><section style="margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;">输出如下则安装成功:</span></section><p cid="n44" mdtype="paragraph" style="white-space: normal;"><span style="min-width: 10px;min-height: 10px;word-break: break-all;font-family: monospace;vertical-align: top;text-align: center;display: inline-block;width: 800px;font-size: 15px;"><img data-ratio="0.20937042459736457" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fqtMZwPicg22mDbQz3GnVhdhaY1QQA2dDo3PNTcdxHDB0h9bS7IYOUzg/640?wx_fmt=png" data-type="png" data-w="683" style="box-sizing: border-box; border-width: 0px 4px 0px 2px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: transparent; border-bottom-color: initial; border-left-color: transparent; vertical-align: middle; cursor: default; width: 677px !important; height: auto !important; visibility: visible !important;" _width="677px" class="" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(42)" crossorigin="anonymous" alt="圖片" data-fail="0"></span></p><h1 cid="n45" mdtype="heading" style="margin-top: 15px;margin-bottom: 5px;white-space: normal;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;background-color: rgb(255, 255, 255);"><strong style="font-size: 17px;color: rgb(171, 25, 66);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;">3.3 pytorch-gpu安装</strong></h1><h2 cid="n46" mdtype="heading" style="margin-top: 10px;margin-bottom: 5px;white-space: normal;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;background-color: rgb(255, 255, 255);"><span style="font-size: 15px;"><strong style="font-size: 17px;color: rgb(171, 25, 66);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;">3.3.1 GPU驱动安装</strong></span></h2><ul class="list-paddingleft-1" style="width: 577.593px;white-space: normal;list-style-type: square;"><li style="font-weight: bold;color: rgb(171, 25, 66);"><h3 cid="n47" mdtype="heading"><strong><span style="font-size: 15px;">检测显卡类型</span></strong></h3></li></ul><p cid="n48" mdtype="paragraph" style="white-space: normal;"><span style="font-size: 15px;">执行命令:' ubuntu-drivers devices'</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="cpp"><code><span class="code-snippet_outer">== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==</span></code><code><span class="code-snippet_outer">modalias : pci:v000010DEd00001C8Dsv00001028sd0000086Fbc03sc02i00</span></code><code><span class="code-snippet_outer">vendor : NVIDIA Corporation</span></code><code><span class="code-snippet_outer">model : GP107M [GeForce GTX 1050 Mobile]</span></code><code><span class="code-snippet_outer">driver : nvidia-driver-390 - distro non-free</span></code><code><span class="code-snippet_outer">driver : nvidia-driver-435 - distro non-free</span></code><code><span class="code-snippet_outer">driver : nvidia-driver-440 - distro non-free recommended</span></code><code><span class="code-snippet_outer">driver : xserver-xorg-video-nouveau - distro free builtin</span></code><code><span class="code-snippet_outer"><br></span></code><code><span class="code-snippet_outer">== /sys/devices/pci0000:00/0000:00:14.3 ==</span></code><code><span class="code-snippet_outer">modalias : pci:v00008086d0000A370sv00008086sd000042A4bc02sc80i00</span></code><code><span class="code-snippet_outer">vendor : Intel Corporation</span></code><code><span class="code-snippet_outer">model : Wireless-AC 9560 [Jefferson Peak]</span></code><code><span class="code-snippet_outer">manual_install: True</span></code><code><span class="code-snippet_outer">driver : backport-iwlwifi-dkms - distro free</span></code></pre></section><p cid="n50" mdtype="paragraph" style="white-space: normal;"><span style="font-size: 15px;">大家可以看到,这里有个设备是GTX1050。推荐安装驱动是440。</span></p><p cid="n50" mdtype="paragraph" style="white-space: normal;"><br></p><ul class="list-paddingleft-1" style="width: 577.593px;white-space: normal;list-style-type: square;"><li style="font-weight: bold;color: rgb(171, 25, 66);"><h3 cid="n51" mdtype="heading"><strong><span style="font-size: 15px;">安装驱动</span></strong></h3></li></ul><p cid="n53" mdtype="paragraph" style="white-space: normal;"><span style="font-size: 15px;">安装所有推荐驱动</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer">sudo ubuntu-drivers autoinstall</span></code></pre></section><p cid="n53" mdtype="paragraph" style="white-space: normal;"><span style="font-size: 15px;">安装一个驱动</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer">sudo apt install nvidia-440</span></code></pre></section><h2 cid="n56" mdtype="heading" style="margin-top: 10px;margin-bottom: 5px;white-space: normal;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;background-color: rgb(255, 255, 255);"><span style="font-size: 15px;"><strong style="font-size: 17px;color: rgb(171, 25, 66);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;">3.3.2 安装cuda</strong></span></h2><p cid="n57" mdtype="paragraph" style="white-space: normal;"><span style="font-size: 15px;">cuda安装需要对应合适的显卡驱动。下面是驱动和cuda的版本对应关系</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="properties"><code><span class="code-snippet_outer">Table 1. CUDA Toolkit and Compatible Driver Versions</span></code><code><span class="code-snippet_outer">CUDA Toolkit Linux x86_64 Driver Version Windows x86_64 Driver Version</span></code><code><span class="code-snippet_outer">CUDA 10.2.89 >= 440.33 >= 441.22</span></code><code><span class="code-snippet_outer">CUDA 10.1 (10.1.105 general release, and updates) >= 418.39 >= 418.96</span></code><code><span class="code-snippet_outer">CUDA 10.0.130 >= 410.48 >= 411.31</span></code><code><span class="code-snippet_outer">CUDA 9.2 (9.2.148 Update 1) >= 396.37 >= 398.26</span></code><code><span class="code-snippet_outer">CUDA 9.2 (9.2.88) >= 396.26 >= 397.44</span></code><code><span class="code-snippet_outer">CUDA 9.1 (9.1.85) >= 390.46 >= 391.29</span></code><code><span class="code-snippet_outer">CUDA 9.0 (9.0.76) >= 384.81 >= 385.54</span></code><code><span class="code-snippet_outer">CUDA 8.0 (8.0.61 GA2) >= 375.26 >= 376.51</span></code><code><span class="code-snippet_outer">CUDA 8.0 (8.0.44) >= 367.48 >= 369.30</span></code><code><span class="code-snippet_outer">CUDA 7.5 (7.5.16) >= 352.31 >= 353.66</span></code><code><span class="code-snippet_outer">CUDA 7.0 (7.0.28) >= 346.46 >= 347.62</span></code></pre></section><p style="margin-bottom: 10px;white-space: normal;"><span style="font-size: 13px;">cuda下载链接:http://suo.im/6dY8rL</span></p><p cid="n62" mdtype="paragraph" style="white-space: normal;"><span style="font-size: 15px;">Installer Type选择第一第二个都可。但是要在获得cuda文件后先检测gcc版本。下面以第一个runfile(local)安装方式为例。</span></p><p cid="n62" mdtype="paragraph" style="white-space: normal;"><br></p><ul class="list-paddingleft-1" style="width: 577.593px;white-space: normal;list-style-type: square;"><li style="font-weight: bold;color: rgb(171, 25, 66);"><h3 cid="n64" mdtype="heading"><strong><span style="font-size: 15px;">安装gcc</span></strong></h3></li></ul><p cid="n65" mdtype="paragraph" style="white-space: normal;"><span style="font-size: 15px;">linux一般会自带了gcc,我们先检测一下自己系统的gcc版本</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer">gcc --version</span></code></pre></section><p style="margin-top: 10px;margin-bottom: 15px;white-space: normal;"><span style="font-size: 15px;">而cuda的gcc依赖版本在官方文档的安装指南上会给出</span></p><p cid="n67" mdtype="paragraph" style="white-space: normal;"><span style="font-size: 15px;min-width: 10px;min-height: 10px;word-break: break-all;font-family: monospace;vertical-align: top;text-align: center;"><img class="rich_pages wxw-img" data-backh="206" data-backw="572.0162" data-ratio="0.3605371900826446" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fEV0YcbUibNNgGd6wt8DtCTB7AHhCW3Eblv1Hu4Gz5zTwgaBrTYfiaAZg/640?wx_fmt=png" data-type="png" data-w="968" style="box-sizing: border-box; border-width: 0px 4px 0px 2px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: transparent; border-bottom-color: initial; border-left-color: transparent; vertical-align: middle; cursor: default; width: 578.171px !important; height: auto !important; visibility: visible !important;" _width="578.171px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(43)" crossorigin="anonymous" alt="圖片" data-fail="0"></span></p><p cid="n68" mdtype="paragraph" style="white-space: normal;"><span style="min-width: 10px;min-height: 10px;word-break: break-all;font-family: monospace;vertical-align: top;text-align: center;display: inline-block;width: 800px;font-size: 15px;"><img class="rich_pages wxw-img" data-backh="391" data-backw="572.0162" data-ratio="0.6833740831295844" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fHgkt0LX69cHmHvLoDWMo9pibxLD8fdPuKwibBjnnM9ibGjj4qpLA1qQKQ/640?wx_fmt=png" data-type="png" data-w="818" style="box-sizing: border-box; border-width: 0px 4px 0px 2px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: transparent; border-bottom-color: initial; border-left-color: transparent; vertical-align: middle; cursor: default; width: 578.171px !important; height: auto !important; visibility: visible !important;" _width="578.171px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(44)" crossorigin="anonymous" alt="圖片" data-fail="0"></span></p><section style="margin-top: 10px;white-space: normal;"><span style="font-size: 15px;">如果版本和cuda依赖gcc不对应,就安装cuda需要的版本</span></section><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li></ul><pre class="code-snippet__js" data-lang="sql"><code><span class="code-snippet_outer">sudo apt-get install gcc-7.0</span></code><code><span class="code-snippet_outer">sudo apt-get install g++-7.0</span></code></pre></section><p cid="n71" mdtype="paragraph" style="white-space: normal;"><span style="font-size: 15px;">安装完成后需要更换系统gcc版本</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li></ul><pre class="code-snippet__js" data-lang="sql"><code><span class="code-snippet_outer">sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 50</span></code><code><span class="code-snippet_outer">sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 50</span></code></pre></section><p cid="n73" mdtype="paragraph" style="white-space: normal;"><span style="font-size: 15px;">选择需要的版本</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="sql"><code><span class="code-snippet_outer">sudo update-alternatives --config gcc</span></code><code><span class="code-snippet_outer"><br></span></code><code><span class="code-snippet_outer"> 选择 路径 优先级 状态</span></code><code><span class="code-snippet_outer">------------------------------------------------------------</span></code><code><span class="code-snippet_outer">* 0 /usr/bin/gcc-9 50 自动模式</span></code><code><span class="code-snippet_outer"> 1 /usr/bin/g++-9 50 手动模式</span></code><code><span class="code-snippet_outer"> 2 /usr/bin/gcc-7 50 手动模式</span></code></pre></section><section style="margin-top: 10px;white-space: normal;"><span style="font-size: 15px;">输入前面显示的编号即可。</span></section><section style="white-space: normal;"><br></section><ul class="list-paddingleft-1" style="width: 577.593px;white-space: normal;list-style-type: square;"><li style="font-weight: bold;color: rgb(171, 25, 66);"><h3 cid="n76" mdtype="heading"><strong><span style="font-size: 15px;">安装cuda</span></strong></h3></li></ul><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="css"><code><span class="code-snippet_outer">sudo sh cuda_你的版本_linux.run</span></code></pre></section><h3 cid="n78" mdtype="heading" style="white-space: normal;"><br></h3><ul class="list-paddingleft-1" style="width: 577.593px;white-space: normal;list-style-type: square;"><li style="font-weight: bold;color: rgb(171, 25, 66);"><h3 cid="n78" mdtype="heading"><strong><span style="font-size: 15px;">配置环境变量</span></strong></h3></li></ul><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer">sudo vim ~/.bashrc</span></code></pre></section><p cid="n80" mdtype="paragraph" style="white-space: normal;"><span style="font-size: 15px;">将下面的命令复制进去</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li></ul><pre class="code-snippet__js" data-lang="ruby"><code><span class="code-snippet_outer">export PATH=/usr/local/cuda-10.2/bin${PATH:+:$PATH}} </span></code><code><span class="code-snippet_outer">export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}</span></code></pre></section><p cid="n82" mdtype="paragraph" style="white-space: normal;"><span style="font-size: 15px;">检查是否安装成功</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer">nvcc -V</span></code></pre></section><h2 cid="n84" mdtype="heading" style="margin-top: 15px;margin-bottom: 5px;white-space: normal;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;background-color: rgb(255, 255, 255);"><span style="font-size: 15px;"><strong style="font-size: 17px;color: rgb(171, 25, 66);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;">3.3.3 安装cudnn</strong></span></h2><p cid="n85" mdtype="paragraph" style="white-space: normal;"><span style="font-size: 15px;">https://developer.nvidia.com/cudnn 选择对应cuda的版本即可</span></p><p cid="n86" mdtype="paragraph" style="white-space: normal;"><span style="min-width: 10px;min-height: 10px;word-break: break-all;font-family: monospace;vertical-align: top;text-align: center;display: inline-block;width: 800px;font-size: 15px;"><img class="rich_pages wxw-img" data-ratio="1.208888888888889" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fdhJEDuSO4piaUUDP3a21Xhiaq9dKxvXB0a2VvicricViaq4hLu9AUfDcMVw/640?wx_fmt=png" data-type="png" data-w="450" style="box-sizing: border-box; border-width: 0px 4px 0px 2px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: transparent; border-bottom-color: initial; border-left-color: transparent; vertical-align: middle; cursor: default; width: 450px !important; height: auto !important; visibility: visible !important;" _width="450px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(45)" crossorigin="anonymous" alt="圖片" data-fail="0"></span></p><p style="margin-top: 10px;margin-bottom: 10px;white-space: normal;"><span style="font-size: 15px;">然后将cudnn解压后的include和lib64文件夹复制到cuda中</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="ruby"><code><span class="code-snippet_outer">sudo cp cuda/include/cudnn.h /usr/local/cuda-10.2/include #解压后的文件夹名字为cuda-10.2 </span></code><code><span class="code-snippet_outer">sudo cp cuda/lib64/libcudnn* /usr/local/cuda-10.2/lib64</span></code><code><span class="code-snippet_outer">sudo chmod a+r /usr/local/cuda-10.2/include/cudnn.h /usr/local/cuda-10.2/lib64/libcudnn*</span></code></pre></section><h2 cid="n89" mdtype="heading" style="margin-top: 15px;margin-bottom: 5px;white-space: normal;font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;background-color: rgb(255, 255, 255);"><span style="font-size: 15px;"><strong style="font-size: 17px;color: rgb(171, 25, 66);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;">3.3.4 安装pytorch-gpu</strong></span></h2><p cid="n90" mdtype="paragraph" style="white-space: normal;"><span style="min-width: 10px;min-height: 10px;word-break: break-all;font-family: monospace;vertical-align: top;text-align: center;display: inline-block;width: 800px;font-size: 15px;"><img class="rich_pages wxw-img" data-ratio="0.627497062279671" data-src="https://mmbiz.qpic.cn/mmbiz_png/vI9nYe94fsHF5g2hb3YqSl9vp653Vm2fsB3mCN9yibmbGIuEM3WVGUWRXlLWHZnIk9Qic831NSib5ynakTcibIqEEw/640?wx_fmt=png" data-type="png" data-w="851" style="box-sizing: border-box; border-width: 0px 4px 0px 2px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: transparent; border-bottom-color: initial; border-left-color: transparent; vertical-align: middle; cursor: default; width: 677px !important; height: auto !important; visibility: visible !important;" _width="677px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(46)" crossorigin="anonymous" alt="圖片" data-fail="0"></span></p><p cid="n91" mdtype="paragraph" style="white-space: normal;"><span style="font-size: 15px;">conda安装:</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer"># 选择自己对应的cuda版本</span></code><code><span class="code-snippet_outer">conda install pytorch torchvision cudatoolkit=10.2</span></code></pre></section><p cid="n93" mdtype="paragraph" style="white-space: normal;"><span style="font-size: 15px;">pip安装:</span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="javascript"><code><span class="code-snippet_outer">pip install torch torchvision -i https://pypi.mirrors.ustc.edu.cn/simple</span></code></pre></section><pre spellcheck="false" cid="n94" mdtype="fences"><br></pre><section style="white-space: normal;"><strong><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;color: rgb(171, 25, 66);font-size: 18px;">四、写在最后</span></strong><br></section><section style="margin-bottom: 15px;"><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;">所有的深度学习环境安装指南到这里就结束了,希望能解决你面临的环境配置难题。关于实践项目,可以结合阿里天池的学习赛进行动手实践。</span></section><pre style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: 0.544px;orphans: 2;text-indent: 0px;text-transform: none;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;text-align: left;font-size: 16px;caret-color: rgb(62, 62, 62);background-color: rgb(255, 255, 255);font-weight: 700;widows: 1;word-spacing: 1px;color: rgb(62, 62, 62);box-sizing: border-box !important;overflow-wrap: break-word !important;"><section data-role="outer" label="Powered by 135editor.com" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: rgb(34, 34, 34);font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;font-size: 16px;text-align: left;background-color: rgb(255, 255, 255);visibility: visible;"><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;text-align: center;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;"><strong style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-family: 微软雅黑, "Microsoft YaHei";color: rgb(122, 79, 214);">好消息!</span></strong></span></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;text-align: center;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: rgb(0, 0, 0);font-size: 14px;"><strong style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-family: 微软雅黑, "Microsoft YaHei";">小白学视觉知识星球</span></strong></span></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;text-align: center;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-family: 微软雅黑, "Microsoft YaHei";font-size: 14px;">开始面向外开放啦👇👇👇</span></p></section><pre style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;font-size: 16px;color: rgb(75, 75, 75);background-color: rgb(255, 255, 255);text-align: center;"><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;white-space: normal;letter-spacing: 0.544px;color: rgb(0, 0, 0);line-height: 1.75em;font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, Arial, sans-serif;"><br style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"></p><section data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;white-space: normal;visibility: visible;"><p style="margin: 0px 0px 0em;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;"><img class="rich_pages wxw-img" data-croporisrc="https://mmbiz.qlogo.cn/sz_mmbiz_png/4AqSEnNUeribBEqP3Xiae5TFTibIGfaVA7pTMuO0uFIDvo4ElyClYt5b9oMqZ8MAlmrCI9AiaOmrFHxSibNxX44YcAg/0?wx_fmt=png" data-cropx1="7.785467128027682" data-cropx2="898.4429065743946" data-cropy1="15.570934256055363" data-cropy2="485.8131487889273" data-ratio="0.5274971941638609" data-s="300,640" data-type="jpeg" data-w="891" data-src="https://mmbiz.qpic.cn/sz_mmbiz_jpg/4AqSEnNUeribBEqP3Xiae5TFTibIGfaVA7pJ1kbHFp3zUjsJIRicRkDA8fy7q3dsO8Op8cibPKdDrKJsk7d5sOrxxxw/640?wx_fmt=jpeg&wxfrom=5&wx_lazy=1&wx_co=1" style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; vertical-align: bottom; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible !important; width: 534px !important; height: auto !important;" _width="534px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(47)" crossorigin="anonymous" alt="圖片" data-fail="0"></p><p style="margin: 0px 0px 0em;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;"><br style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"></p></section><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;"><br style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"></p><pre style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;"><section mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;font-weight: 700;orphans: 4;text-align: left;widows: 1;word-spacing: 1px;caret-color: rgb(38, 17, 32);min-height: 1em;color: rgba(0, 0, 0, 0.8);"><strong mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;color: rgb(0, 128, 255);font-size: 18px;">下载1:OpenCV-Contrib扩展模块中文版教程</strong><br mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"></section><section mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;font-weight: 700;orphans: 4;text-align: left;widows: 1;word-spacing: 1px;caret-color: rgb(38, 17, 32);min-height: 1em;color: rgba(0, 0, 0, 0.8);"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 15px;">在「<strong mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;">小白学视觉</span></strong>」公众号后台回复:</span><strong mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 15px;color: rgb(255, 104, 39);">扩展模块中文教程</span></strong><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 15px;"><strong mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: rgb(255, 0, 0);">,</strong>即可下载全网第一份OpenCV扩展模块教程中文版,涵盖<strong mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;">扩展模块安装、SFM算法、立体视觉、目标跟踪、生物视觉、超分辨率处理</strong>等二十多章内容。</span></section><section mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;font-weight: 700;orphans: 4;text-align: left;widows: 1;word-spacing: 1px;caret-color: rgb(38, 17, 32);min-height: 1em;color: rgba(0, 0, 0, 0.8);"><br mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"></section><section mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;font-weight: 700;orphans: 4;text-align: left;widows: 1;word-spacing: 1px;caret-color: rgb(38, 17, 32);min-height: 1em;color: rgba(0, 0, 0, 0.8);"><strong mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;color: rgb(0, 128, 255);font-size: 18px;">下载2:Python视觉实战项目52讲</strong></section><section mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;font-weight: 700;orphans: 4;text-align: left;widows: 1;word-spacing: 1px;caret-color: rgb(38, 17, 32);min-height: 1em;color: rgba(0, 0, 0, 0.8);"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;font-size: 15px;">在<span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;">「<strong mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;">小白学视觉</span></strong>」</span>公众号后台回复:<span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;"><strong mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;color: rgb(255, 104, 39);">Python视觉实战项目</span></strong></span><strong mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;color: rgb(255, 0, 0);">,</strong><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;">即可下载包括<strong mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;">图像分割、口罩检测、车道线检测、车辆计数、添加眼线、车牌识别、字符识别、情绪检测、文本内容提取、面部识别</strong>等31个视觉实战项目,助力快速学校计算机视觉。</span></span></section><section mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;font-weight: 700;orphans: 4;text-align: left;widows: 1;word-spacing: 1px;caret-color: rgb(38, 17, 32);min-height: 1em;color: rgba(0, 0, 0, 0.8);"><br mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"></section><section mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;font-weight: 700;orphans: 4;text-align: left;widows: 1;word-spacing: 1px;caret-color: rgb(38, 17, 32);min-height: 1em;color: rgba(0, 0, 0, 0.8);"><strong mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;color: rgb(0, 128, 255);font-size: 18px;">下载3:OpenCV实战项目20讲</strong></section><section mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;font-weight: 700;orphans: 4;text-align: left;widows: 1;word-spacing: 1px;caret-color: rgb(38, 17, 32);min-height: 1em;color: rgba(0, 0, 0, 0.8);"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;font-size: 15px;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;">在<span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;">「<strong mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;">小白学视觉</span></strong>」</span>公众号后台回复:<strong mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;color: rgb(255, 104, 39);">OpenCV实战项目20讲</span></strong></span><strong mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;color: rgb(255, 0, 0);">,</strong><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;">即可下载含有<strong mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;">20</strong>个基于<strong mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;">OpenCV</strong>实现20个<strong mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;">实战项目</strong>,实现OpenCV学习进阶。</span></span></section><section mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;font-weight: 700;orphans: 4;text-align: left;widows: 1;word-spacing: 1px;caret-color: rgb(38, 17, 32);min-height: 1em;color: rgba(0, 0, 0, 0.8);"><br mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"></section><p style="margin: 0px 0px 0em;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;white-space: normal;font-size: medium;font-weight: 700;orphans: 4;widows: 1;word-spacing: 1px;caret-color: rgb(38, 17, 32);letter-spacing: 1px;color: rgba(0, 0, 0, 0.8);line-height: 25.6px;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: inherit;font-size: inherit;letter-spacing: 0.544px;">交流群</span><br mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"></p><p style="margin: 0px 0px 0em;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;white-space: normal;font-size: medium;font-weight: 700;orphans: 4;widows: 1;word-spacing: 1px;caret-color: rgb(38, 17, 32);letter-spacing: 1px;color: rgba(0, 0, 0, 0.8);line-height: 25.6px;"><br mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"></p><p style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;font-weight: 700;orphans: 4;text-align: left;widows: 1;word-spacing: 1px;caret-color: rgb(38, 17, 32);color: rgb(62, 62, 62);"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 15px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">歡迎加入公眾號讀者群一起和同行交流,目前有</font></font><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-weight: bolder;letter-spacing: 0.544px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">SLAM </font></font><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-weight: bolder;letter-spacing: 0.544px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">、三維視覺</font></font></span><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">、傳感器</font></font><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-weight: bolder;letter-spacing: 0.544px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">、</font></font><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-weight: bolder;letter-spacing: 0.544px;"><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-weight: bolder;letter-spacing: 0.544px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">自動駕駛、</font></font></span><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">計算攝影</font></font></span></span></span><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">、檢測、分割、識別、</font></font><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-weight: bolder;letter-spacing: 0.544px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">醫學影像、GAN </font></font><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-weight: bolder;letter-spacing: 0.544px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">、</font></font><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-weight: bolder;letter-spacing: 0.544px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">算法競賽</font></font></span></span></span><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">等微信群(以後會逐漸細分),</font></font></span><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 15px;letter-spacing: 0.544px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">請掃描下面微信號加群,備註:”暱稱+學校/公司+研究方向“,例如:”張三 + 上海交大 + 視覺SLAM“。</font></font><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-weight: bolder;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">請按照格式備註,否則不予通過</font></font></span><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">。</font><font style="vertical-align: inherit;">添加成功後會根據研究方向邀請進入相關微信群。</font></font><strong mpa-from-tpl="t" style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">請勿</font></font></strong><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">在群內發送</font></font><span style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-weight: bolder;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">廣告</font></font></span><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">,否則會請出群,謝謝理解~</font></font></span></p><p style="margin: 0px 0px 0em;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;"><img class="rich_pages wxw-img" data-galleryid="" data-ratio="1" data-s="300,640" data-type="jpeg" data-w="430" data-src="https://mmbiz.qpic.cn/sz_mmbiz_jpg/4AqSEnNUeric5L4iaE0Ev62IMvcQhyKHgGtrLkTO4pa7aMsoWkoT5wOkrHDiaNfPK1tTfTKLpxC8fyVxnjwjV3AuA/640?wx_fmt=jpeg&wxfrom=5&wx_lazy=1&wx_co=1" style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; vertical-align: bottom; background-color: rgb(238, 237, 235); border-width: 1px; border-style: solid; border-color: rgb(238, 237, 235); background-size: 40px; background-position: center center; background-repeat: no-repeat; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible !important; width: 133px !important; height: auto !important;" _width="133px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(48)" crossorigin="anonymous" alt="圖片" data-fail="0"></p><p style="margin: 0px 0px 0em;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;"><br style="margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"></p><p style="margin: 0px 0px 0em;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;font-weight: 700;orphans: 4;widows: 1;word-spacing: 1px;caret-color: rgb(38, 17, 32);"><img class="rich_pages wxw-img" data-ratio="0.5787671232876712" data-s="300,640" data-src="https://mmbiz.qpic.cn/mmbiz_png/4AqSEnNUer8Co8oDDJzFWWECpytMibasA1TMFTFGku5JPkwhp0ywxsmibkOhmichYM6iah0YrIYSsRn9YFWYXuic5Iw/640?wx_fmt=jpeg&wxfrom=5&wx_lazy=1&wx_co=1" data-type="jpeg" data-w="876" style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; vertical-align: bottom; background-color: rgb(238, 237, 235); border-width: 1px; border-style: solid; border-color: rgb(238, 237, 235); background-size: 40px; background-position: center center; background-repeat: no-repeat; letter-spacing: 0.544px; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible !important; width: 677px !important; height: auto !important;" _width="677px" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/640(49)" crossorigin="anonymous" alt="圖片" data-fail="0"></p></pre></pre></pre></div>
<script type="text/javascript" nonce="" reportloaderror="">
var first_sceen__time = (+new Date());
if ("" == 1 && document.getElementById('js_content')) {
document.getElementById('js_content').addEventListener("selectstart",function(e){ e.preventDefault(); });
}
</script>
<div id="reward_area"><!----><!----></div>
</div>
<div id="js_tags_preview_toast" class="article-tag__error-tips" style="display: none;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">預覽時標籤不可點</font></font></div>
<div id="content_bottom_area"><div class="appmsg_card_context album_read_card" style="display: none;"><!----></div><div class="rich_media_tool_area"><div class="rich_media_tool__wrp"><div id="js_toobar3" class="rich_media_tool"><!----><div class="weui-flex"><div class="weui-flex__item"><!----><!----></div></div><div id="js_bottom_opr_right" class="weui-flex sns_opr_area sns_opr_overflow" style="display: none;"><!----></div></div><!----></div></div><!----></div>
</div>
</div>
<div class="rich_media_area_primary sougou" id="sg_tj" style="display:none"></div>
<div class="rich_media_area_extra">
<div class="rich_media_area_extra_inner">
<div id="page_bottom_area"><div class="related_container"><div class="relate_mod_transition function_mod js_related_area" style="overflow: visible; opacity: 1; height: 8.68125em; margin: 12px 0px 0px; transition: none 0s ease 0s;"><div class="function_mod_index js_related_main"><div class="function_hd js_related_title"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">喜歡此內容的人還喜歡</font></font></div><div class="function_bd"><div class="relate_article_index_list relate_article_list js_related_list" style="height: auto;"><div data-index="0" data-url="http://mp.weixin.qq.com/s?__biz=MzU0NjgzMDIxMQ==&mid=2247597727&idx=4&sn=283aa721cd00c5a6fec48da2a4c277ac&chksm=fb549c73cc231565a482a4146eaf04e3cc06f96d507cf8323dc7c67620bbc4084817cdc50aa2&scene=132#wechat_redirect" data-time="1661306700" data-recalltype="111001" data-isreaded="0" data-bizuin="3546830211" data-mid="2247597727" data-idx="4" data-item_show_type="0" data-exptype="" data-ext_info="{&quot;rec_info&quot;:{&quot;model_id&quot;:1131,&quot;rank_rk&quot;:&quot;1131:11650:0:40:1&quot;,&quot;recall_rk&quot;:&quot;111001:11:0&quot;}}" data-report_info="{}" class="weui-media-box weui-media-box_appmsg js_related_item js_wx_tap_highlight wx_tap_cell"><div class="weui-media-box__bd"><div role="link" tabindex="0" aria-labelledby="relate_article_title_2247597727_4 js_a11y_comma relate_article_nickname_2247597727_4 js_a11y_comma relate_article_num_2247597727_4" class="ellipsis_relate_title mask_ellipsis_wrp mask_ellipsis_auto_height relate_article_default"><div aria-hidden="true" class="mask_ellipsis_text"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">機器學習的核心概念置信度和置信區間,我用這個例子把它講明白</font></font><!----></div><div aria-hidden="true" class="mask_ellipsis"><div id="relate_article_title_2247597727_4" class="mask_ellipsis_text"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">機器學習的核心概念置信度和置信區間,我用這個例子把它講明白</font></font><!----></div><div class="mask_ellipsis_placeholder"></div><div class="mask_ellipsis_extra"> <!----></div></div></div><div class="weui-media-box__info weui-flex"><div class="weui-media-box__info__inner weui-flex weui-flex__item"><div aria-hidden="true" id="relate_article_nickname_2247597727_4" data-username="gh_cbf5c51a9925" class="js_profile relate_profile_nickname weui-media-box__info__meta"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">小白學視覺</font></font></div><div aria-hidden="true" id="relate_article_num_2247597727_4" class="weui-media-box__info__meta"><!----></div></div><div class="relate_article_opr"><button type="button" class="reset_btn dislike_btn js_feedback_btn weui-wa-hotarea"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">不喜歡</font></font></button></div><div role="dialog" aria-modal="true" tabindex="0" aria-hidden="true" class="feedback_dialog_wrp js_feedback_dialog"><div role="button" aria-label="關閉" class="weui-mask js_mask"></div><div class="feedback_dialog js_dialog_wrp"><div class="feedback_dialog_hd weui-flex"><div class="weui-flex__item feedback_dialog_title"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">不看的原因</font></font></div><button type="button" class="weui-btn weui-btn_primary weui-btn_mini js_submit weui-btn_disabled"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">確定</font></font></button></div><div class="feedback_dialog_bd"><ul class="feedback_tag_list"><li role="checkbox" data-value="1" class="feedback_tag_item js_reason js_tag_item"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">內容質量低</font></font></li><li role="checkbox" data-value="2" class="feedback_tag_item js_reason js_tag_item"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">不看此公眾號</font></font></li></ul></div></div></div></div></div><div class="weui-media-box__ft"><img class="relate_article_cover" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/0(1)"></div></div></div></div></div></div></div><div class="mpda_bottom_container"><!----></div><div><!----></div></div>
</div>
</div>
<div id="js_pc_qr_code" class="qr_code_pc_outer" style="display: block;">
<div class="qr_code_pc_inner">
<div class="qr_code_pc">
<img id="js_pc_qr_code_img" class="qr_code_pc_img" src="./深度學習環境配置指南! (Windows、Mac、Ubuntu全講解)_files/qrcode">
<p><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">微信掃一掃</font></font><br><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">關注該公眾號</font></font></p>
</div>
</div>
</div>
</div>
</div>
<div class="comment_primary_emotion_panel_wrp" id="js_emotion_panel_pc" style="display: none">
<div class="comment_primary_emotion_panel">
<ul class="comment_primary_emotion_list_pc" id="js_emotion_list_pc">
</ul>
</div>
</div>
<div class="weui-dialog__wrp" id="js_alert_panel" style="display:none;">
<div class="weui-mask"></div>
<div class="weui-dialog">
<div class="weui-dialog__bd" id="js_alert_content"></div>
<div class="weui-dialog__ft">
<a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_default" id="js_alert_confirm"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">知道了</font></font></a>
</div>
</div>
</div>
<script type="text/javascript" nonce="" reportloaderror="">
window.img_popup = 1; // 全量小程序弹窗
</script>
<div id="js_pc_weapp_code" class="weui-desktop-popover weui-desktop-popover_pos-up-center weui-desktop-popover_img-text" style="display: none;">
<div class="weui-desktop-popover__content">
<div class="weui-desktop-popover__desc">
<img id="js_pc_weapp_code_img"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">
微信掃一掃</font></font><br><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">使用小程序</font></font><span id="js_pc_weapp_code_des"></span>
</div>
</div>
</div>
<div id="js_minipro_dialog" role="dialog" aria-modal="true" tabindex="0" aria-labelledby="js_minipro_dialog_head" style="display:none;">
<div class="weui-mask"></div>
<div class="weui-dialog weui-dialog_link">
<div class="weui-dialog__hd">
<strong class="weui-dialog__title" id="js_minipro_dialog_head" tabindex="0"></strong>
</div>
<div class="weui-dialog__bd" id="js_minipro_dialog_body"></div>
<div class="weui-dialog__ft">
<a role="button" id="js_minipro_dialog_cancel" href="javascript:void(0);" class="weui-dialog__btn weui-dialog__btn_default"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">取消</font></font></a>
<a role="button" id="js_minipro_dialog_ok" href="javascript:void(0);" class="weui-dialog__btn weui-dialog__btn_primary"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">允許</font></font></a>
</div>
</div>
</div>
<div id="js_link_dialog" role="dialog" aria-modal="true" tabindex="0" aria-labelledby="js_link_dialog_body" style="display:none;">
<div class="weui-mask"></div>
<div class="weui-dialog weui-dialog_link">
<div class="weui-dialog__hd">
<strong class="weui-dialog__title" id="js_link_dialog_head" tabindex="0"></strong>
</div>
<div class="weui-dialog__bd" id="js_link_dialog_body" tabindex="0"></div>
<div class="weui-dialog__ft">
<a role="button" id="js_link_dialog_cancel" href="javascript:void(0);" class="weui-dialog__btn weui-dialog__btn_default"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">取消</font></font></a>
<a role="button" id="js_link_dialog_ok" href="javascript:void(0);" class="weui-dialog__btn weui-dialog__btn_primary"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">允許</font></font></a>
</div>
</div>
</div>
<script type="text/javascript" nonce="" reportloaderror="">
window.logs.pagetime.page_begin = Date.now();
// // 广告iframe预加载
try {
var adIframeUrl = localStorage.getItem('__WXLS_ad_iframe_url');
if (window === top) {
if (adIframeUrl) {
if (navigator.userAgent.indexOf('iPhone') > -1) {
var img = new Image();
img.src = adIframeUrl;
} else {
var link = document.createElement('link');
link.rel = 'prefetch';
link.href = adIframeUrl;
document.getElementsByTagName('head')[0].appendChild(link);
}
}
}
} catch (err) {
}
</script>
<span aria-hidden="true" class="weui-a11y_ref" style="display:none" id="js_a11y_colon"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">:</font></font></span>
<span aria-hidden="true" class="weui-a11y_ref" style="display:none" id="js_a11y_comma"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">,</font></font></span>
<span aria-hidden="true" class="weui-a11y_ref" style="display:none" id="js_a11y_period"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">。</font></font></span>
<span aria-hidden="true" class="weui-a11y_ref" style="display:none" id="js_a11y_space"> </span>
<span aria-hidden="true" class="weui-a11y_ref" style="display:none" id="js_a11y_type_video"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">視頻</font></font></span>
<span aria-hidden="true" class="weui-a11y_ref" style="display:none" id="js_a11y_type_weapp"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">小程序</font></font></span>
<span aria-hidden="true" class="weui-a11y_ref" style="display:none" id="js_a11y_zan_btn_txt"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">贊</font></font></span>
<span aria-hidden="true" class="weui-a11y_ref" style="display:none" id="js_a11y_zan_btn_tips"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">,輕點兩下取消贊</font></font></span>
<span aria-hidden="true" class="weui-a11y_ref" style="display:none" id="js_a11y_like_btn_txt"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">在看</font></font></span>
<span aria-hidden="true" class="weui-a11y_ref" style="display:none" id="js_a11y_like_btn_tips"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">,輕點兩下取消在看</font></font></span>
<script type="text/javascript" nonce="" reportloaderror="">
(function () {
var totalCount = 0,
finishCount = 0;
function _addVConsole(uri, cb) {
totalCount++;
var node = document.createElement('SCRIPT');
node.type = 'text/javascript';
node.src = uri;
node.setAttribute('nonce', '116021992');
if (cb) {
node.onload = cb;
}
document.getElementsByTagName('head')[0].appendChild(node);
}
if (
(document.cookie && document.cookie.indexOf('vconsole_open=1') > -1)
|| location.href.indexOf('vconsole=1') > -1
) {
_addVConsole('https://mp.weixin.qq.com/mmbizappmsg/zh_CN/htmledition/js/scripts/vconsole-3.14.6.js', function () {
var vConsole = new window.VConsole();
});
}
})();
</script>
<script type="text/javascript" nonce="" reportloaderror="">var __INLINE_SCRIPT__=function(){"use strict";var e=function(e,n){var t=e;if(e.indexOf("——")>-1){e=e.replace(/——/g,'<span style="letter-spacing:normal">——</span>')}n&&(n.innerHTML=n.innerHTML.replace(t,e))};if(!window.__second_open__){e("深度学习环境配置指南!(Windows、Mac、Ubuntu全讲解)",document.getElementById("activity-name")),window.__setTitle=e}return e}();</script><script type="text/javascript" nonce="" reportloaderror="">var __INLINE_SCRIPT__=function(){"use strict";var e=function(e,t,n,i){var _=new Date(1e3*(1*t)),o=function(e){return"0".concat(e).slice(-2)},r=_.getFullYear()+"-"+o(_.getMonth()+1)+"-"+o(_.getDate())+" "+o(_.getHours())+":"+o(_.getMinutes());i&&(i.innerText=r)};if(!window.__second_open__){e(0,"1661479556",0,document.getElementById("publish_time")),window.__setPubTime=e}return e}();</script>
<script type="text/javascript" nonce="" reportloaderror="">
//兼容 IE
if (!window.console) window.console = { log: function() {} };
// 图片占位 @ekili
if (typeof getComputedStyle == 'undefined') {
if (document.body.currentStyle) {
window.getComputedStyle = function(el) {
return el.currentStyle;