环境依赖库参见如下:
可通过pip install命令安装,命令执行参考如下。
1 | pip install numpy tqdm scikit-learn torch_npu torch |
执行训练脚本前,先执行如下命令设置环境变量。
1 | source /usr/local/Ascend/ascend-toolkit/set_env.sh |
1 | .../libgomp.so: cannot allocate memory in static TLS block |
请执行export LD_PRELOAD=.../libgomp.so(报错中出现的libgomp.so路径)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. auto-tune 0.1.0 requires decorator, which is not installed. dataflow 0.0.1 requires jinja2, which is not installed. opc-tool 0.1.0 requires attrs, which is not installed. opc-tool 0.1.0 requires decorator, which is not installed. opc-tool 0.1.0 requires psutil, which is not installed. schedule-search 0.0.1 requires absl-py, which is not installed. schedule-search 0.0.1 requires decorator, which is not installed. te 0.4.0 requires attrs, which is not installed. te 0.4.0 requires cloudpickle, which is not installed. te 0.4.0 requires decorator, which is not installed. te 0.4.0 requires ml-dtypes, which is not installed. te 0.4.0 requires psutil, which is not installed. te 0.4.0 requires scipy, which is not installed. te 0.4.0 requires tornado, which is not installed. |
1 | pip install attrs cloudpickle decorator jinja2 ml-dtypes psutil scipy tornado absl-py |
1 2 | OpenBLAS warning: precompiled NUM_THREADS exceeded, adding auxiliary array for thread metadata. Segmentation fault (core dumped) |
1 | export OPENBLAS_NUM_THREADS=1 |
该环境变量可能影响性能,码本训练完成后,建议设置回预设值。