在启动LLama-Factory时,一不小心哎呀,报错了,我都是按步骤安装的呀!
开始正题:下面是我报的错,错的太多,也可以不用看,我下面解释。
RuntimeError Traceback (most recent call last)
<ipython-input-3-b727a954f97e> in <cell line: 1>()
----> 1 from unsloth import FastLanguageModel
2 import torch
3 max_seq_length = 2048 # Choose any! We auto support RoPE Scaling internally!
4 dtype = None # None for auto detection. Float16 for Tesla T4, V100, Bfloat16 for Ampere+
5 load_in_4bit = True # Use 4bit quantization to reduce memory usage. Can be False.
3 frames
/usr/local/lib/python3.10/dist-packages/unsloth/__init__.py in <module>
62
63 # Fix up is_bf16_supported https://github.com/unslothai/unsloth/issues/504
---> 64 major_version, minor_version = torch.cuda.get_device_capability()
65 SUPPORTS_BFLOAT16 = (major_version >= 8)
66 def is_bf16_supported(): return SUPPORTS_BFLOAT16
/usr/local/lib/python3.10/dist-packages/torch/cuda/__init__.py in get_device_capability(device)
428 tuple(int, int): the major and minor cuda capability of the device
429 """
--> 430 prop = get_device_properties(device)
431 return prop.major, prop.minor
432
/usr/local/lib/python3.10/dist-packages/torch/cuda/__init__.py in get_device_properties(device)
442 _CudaDeviceProperties: the properties of the device
443 """
--> 444 _lazy_init() # will define _get_device_properties
445 device = _get_device_index(device, optional=True)
446 if device < 0 or device >= device_count():
报错大意是在检测GPU时,没有发现CUDA。这怎么可能呢,我看了一下我的版本
CUDA 12.0在这里,我就觉得——我又行了,后来搜了一下。
注意:这个地方并不是你的电脑安装版本,而是你驱动最大能支持的版本。
大家可以执行以下命令,查看你的cuda运行时版本,这才是我们真正使用的版本。
nvcc -V
那我们如何更新我们的版本呢,根据你的需求和你电脑最大支持的版本,在官网重新下载CUDA Toolkit。
详细的安装教程这里就不写了。安装成功后再执行,就会出现你最新安装的版本。