使用runner配置微调环境时,提示“尝试增加虚拟内存(WSL Swap)”

RT,在WSL提示的是:

--load_model models/RWKV-4-ABC-82M-v1-20230805-ctx1024.pth --data_file ./finetune/json2binidx_tool/data/sample_text_document --ctx_len 150 --epoch_steps 200 --epoch_count 20 --epoch_begin 0 --epoch_save 1 --micro_bsz 1 --accumulate_grad_batches 8 --pre_ffn 0 --head_qk 0 --lr_init 5e-5 --lr_final 5e-5 --warmup_steps 0 --beta1 0.9 --beta2 0.999 --adam_eps 1e-8 --devices 1 --precision bf16 --grad_cp 1 --lora_r 64 --lora_alpha 192 --lora_dropout 0.01
apt cnMirror already set
gcc installed
pip installed
python3-dev installed
ninja installed
cuda 12 installed
requirements satisfied
loading models/RWKV-4-ABC-82M-v1-20230805-ctx1024.pth
Traceback (most recent call last):
File "/mnt/d/rwkm/./finetune/get_layer_and_embd.py", line 32, in <module>
w = torch.load(model_file, map_location="cpu")
AttributeError: module 'torch' has no attribute 'load'
modelInfo is invalid

切换到WSL,输入并运行:pip install torch 或者pip install lightning deepspeed返回的是
WARNING: Running pip as the ‘root’ user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

不知道是哪里环境部署有问题

在WSL下输入pip show torch看看结果是什么

回显

WSL> pip show torch
Name: torch
Version: 2.2.0
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
Author-email: packages@pytorch.org
License: BSD-3
Location: /usr/local/lib/python3.10/dist-packages
Requires: filelock, fsspec, jinja2, networkx, nvidia-cublas-cu12, nvidia-cuda-cupti-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-runtime-cu12, nvidia-cudnn-cu12, nvidia-cufft-cu12, nvidia-curand-cu12, nvidia-cusolver-cu12, nvidia-cusparse-cu12, nvidia-nccl-cu12, nvidia-nvtx-cu12, sympy, triton, typing-extensions
Required-by: bitsandbytes, deepspeed, lightning, pytorch-lightning, torchmetrics

改一下 C:/User/你的用户名 修改一下 .wslconfig