操作系统: 64位Windows10
mxnet的Windows预编译版本:20160531_win10_x64_cpu
分为不支持GPUs和支持GPUs版并,一般选择GPUs版本。
将下载的压缩包解压,比如解压到D:\mxnet。然后双击执行,目录下的 setupenv.cmd 文件,即设置好环境。
语言包安装:Anaconda3
置环境变量:
假设mxnet是解压在D:\mxnet,则设置 PYTHONPATH=d:\mxnet\python
语言支持,安装完毕。
测试安装是否正常:
安装wget:(运行案例脚本 train_mnist.py,要使用到)
设置好环境变量,将wget加入PATH查找路径。
修改目录下的 python example/image-classification/train_mnist.py 文件,将 此文件的第七行开始的 _download() 函数,修改为如下,保存:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
def
_download(data_dir):
## fix for windows
data_dir
=
data_dir.replace(
"/"
, "")
if
not
os.path.isdir(data_dir):
os.system(
"mkdir "
+
data_dir)
os.chdir(data_dir)
## fix for windows
if
(
not
os.path.exists(
'mnist.zip'
)):
os.system(
"wget http://webdocs.cs.ualberta.ca/~bx3/data/mnist.zip"
)
if
(
not
os.path.exists(
'train-images-idx3-ubyte'
))
or
\
(
not
os.path.exists(
'train-labels-idx1-ubyte'
))
or
\
(
not
os.path.exists(
't10k-images-idx3-ubyte'
))
or
\
(
not
os.path.exists(
't10k-labels-idx1-ubyte'
)): <br>
## fix for windows
os.system(
"unzip -u mnist.zip"
)
## os.system("unzip -u mnist.zip; rm mnist.zip")
os.chdir(
".."
)
|
在train_mnist.py脚本中,由于使用了linux的系统命令,所以必须修改。由于我的系统已安装了git,所以有unzip命令,但缺少wget,故安装wget。
打开命令提示符执行命令:
cpu only:
1
|
python example
/image-classification/train_mnist
.py
|
ok了。
现在的问题是 idle没有问题,cmd也没有问题,而 Spyder 没有输出,没有输出,晕