环境配置

miniconda 同意使用协议:

conda tos accept --override-channels --channel <https://repo.anaconda.com/pkgs/main>
conda tos accept --override-channels --channel <https://repo.anaconda.com/pkgs/r>

macOS 下 bash 环境变量

macOS 上似乎需要:

source ~/.bash_profile

Linux 上一般都是 .bashrc 这样的文件用来存储环境变量,macOS 或许是需要手动激活一下,之后就可以正常使用 conda activate 等命令。macOS 默认是 zsh 为什么 conda 不把脚本直接放到 .zshrc 里呢,不是特别理解

mxnet.post1 安装失败

好像只有 Windows 有这个问题,macOS 上顺利安装完成。

解决方法:换用 numpy==1.23.5 搭配 mxnet 1.8.0 可以完成。

pip install numpy==1.23.5
pip install mxnet -f <https://dist.mxnet.io/python/cpu>

Python 3.9 Jupyter Notebook Kernel Outdated

反正现在运行没有太大问题,等出问题了再说

The Jupyter extension supports Kernels running against all active versions of Python as documented here <https://devguide.python.org/#status-of-python-branches> & <https://devguide.python.org/versions/#versions>.
Hence the use of unsupported Python versions in Jupyter kernels is not guaranteed to work as expected. Unexpected behavior could range from cells not running as expected, packages not loading or even the kernel not starting.

https://github.com/microsoft/vscode-jupyter/wiki/Using-unsupported-Python-Environments

CUDA + Pytorch

用 conda 安装,教程中要求的 pytorch 和 vision 版本为:

pip install torch==1.12.0
pip install torchvision==0.13.0

对应的 CUDA Toolkit 版本是 10.2。使用 conda 安装:

conda install pytorch==1.11.0 torchvision==0.12.0 torchaudio==0.11.0 cudatoolkit=10.2 -c pytorch