Windows下pytorch的安装与入门

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/hunterlew/article/details/79450944

上班前的最后一个寒假,接触了pytorch框架。由于家里只有windows笔记本,因此在windows环境下安装。安装方法见https://zhuanlan.zhihu.com/p/26871672。我安装后碰到了如下问题,记录下来以便查阅:

conda install -c peterjc123 pytorch cuda80

报错:UnsatisfiableError: The following specifications were found to be in conflict:

  - pytorch

经多方查阅,发现是conda版本问题,更新conda:

conda update -f conda

conda -V

更新至conda 4.3.30版本,可以顺利安装。

接着再安装torchvision:

pip install torchvision

============================================================================

为入门pytorch,我参照了mnist的官方例子,编写了工程框架,分配了config、data、model等文件夹方便调参,传送门:

https://github.com/hunterlew/pytorch_template

给了个MSTAR数据的例子(雷达目标识别经典数据库),注意到为灰度图像,而用ImageFolder读入默认为三通道(单通道通过复制扩展为三通道),因此在solver.py文件中需要指定取第0个通道输入。

猜你喜欢

转载自blog.csdn.net/hunterlew/article/details/79450944