首页 > 其他分享 >jupyter 下 bitandbytes报错记录

jupyter 下 bitandbytes报错记录

时间:2023-11-06 15:23:59浏览次数:29  
标签:jupyter lib envs miniconda3 bitandbytes bitsandbytes home 报错

背景: 在jupyter 中加载baichuan大模型时报错

报错一: from peft import PeftModel  报错

报错提示:python -m bitsandbytes

执行 python -m bitsandbytes 时又报错,报错内容为:

Traceback (most recent call last):
File "/home/miniconda3/envs/vllm/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/miniconda3/envs/vllm/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/miniconda3/envs/vllm/lib/python3.10/site-packages/bitsandbytes/__main__.py", line 101, in <module>
generate_bug_report_information()
File "/home/miniconda3/envs/vllm/lib/python3.10/site-packages/bitsandbytes/__main__.py", line 59, in generate_bug_report_information
paths = find_file_recursive('/usr/local', '*cuda*so')
File "/home/miniconda3/envs/vllm/lib/python3.10/site-packages/bitsandbytes/__main__.py", line 42, in find_file_recursive
raise RuntimeError('Something when wrong when trying to find file. Maybe you do not have a linux system?')
RuntimeError: Something when wrong when trying to find file. Maybe you do not have a linux system?

 

问题分析:报错原因,执行文件查找命令时,部分目录存在权限问题,把该目录排除出查找范围即可

vim /home/miniconda3/envs/vllm/lib/python3.10/site-packages/bitsandbytes/__main__.py +42

def find_file_recursive(folder, filename):
#cmd = f'find {folder} -name {filename}'
cmd = f'find {folder} -path "/usr/local/xxxxxxxx" -prune -o -name {filename}'
print (cmd)
out, err = execute_and_return(cmd)
if len(err) > 0:
raise RuntimeError('Something when wrong when trying to find file. Maybe you do not have a linux system?')
return out

 

报错二: CUDA SETUP: Loading binary /home/miniconda3/envs/vllm/lib/python3.10/site-packages/bitsandbytes/libbitsandbytes_cuda117_nocublaslt.so...

/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /home/miniconda3/envs/vllm/lib/python3.10/site-packages/bitsandbytes/libbitsandbytes_cuda117_nocublaslt.so)

经分析,bitandbytes代码中cuda设置这部分报错

from bitsandbytes.cuda_setup.main import CUDASetup
setup = CUDASetup.get_instance()
setup.run_cuda_setup()
print (setup.lib)

#None

#该部分报错原因为加载驱动时报错,该部分代码直接在bash中执行时正常,在jupyter中执行结果为None

import ctypes as ct
path = '/home/miniconda3/envs/vllm/lib/python3.10/site-packages/bitsandbytes/libbitsandbytes_cuda117_nocublaslt.so'
lib=ct.cdll.LoadLibrary(path)
print (lib)

 

根据博客:https://www.cnblogs.com/jimlau/p/13263052.html 中方案二解决方案

cp /home/miniconda3/lib/libstdc++.so.6.0.29 /usr/lib64/
rm -f libstdc++.so.6
ln -s libstdc++.so.6.0.29 libstdc++.so.6

至此问题已解决

 

标签:jupyter,lib,envs,miniconda3,bitandbytes,bitsandbytes,home,报错
From: https://www.cnblogs.com/jax-/p/17812736.html

相关文章

  • 使用uniapp开发小程序getLocation报错
    uniapp中使用uni.getLocation()报错,报错如下:getLocation:failtheapineedtobedeclaredintherequiredPrivateInfosfieldinapp.json/ext.json 首先检查uniapp的manifest文件发现位置权限已经开启: 后翻阅微信文档后发现原来是微信官方做了调整,uniapp只勾选这个还......
  • jsqlparser v4.6 版本下sql解析报错
    项目版本:springboot2.7.2mybatis-plus3.5.2jsqlparser4.6该版本下mybatis-plus生成的sql文件带有连续\n\n\nCCJSqlParserUtil.parseStatements("select\n\n\n*from\n\ndual\n")再使用jsqlparser进行sql解析时会出现如下报错net.sf.jsqlparser.parser.ParseExc......
  • Python_pytest +文件名,报错—— zsh: command not found: pytest
     原因:由于“通过pip安装pytest不会使其成为系统命令,而是会将其安装到python”“-m命令将pytest作为其自己的命令运行,然后任何后续脚本都将作为参数。”解决:所以我们在命令窗口执行时应该在.py文件所在路径下执行  python-mpytest-vtest_wework.py这个问题终于......
  • 解决适用EntityFramework生成时报错“无法解析依赖项。"EntityFramework 6.4.4" 与 '
    点击添加,出现错误提示:......
  • R语言install.packages("jpeg")报错
    R语言install.packages("jpeg")时报错Infileincludedfromread.c:1:0:rjcommon.h:11:21:fatalerror:jpeglib.h:Nosuchfileordirectoryrjcommon.h:11:21:致命错误:jpeglib.h:没有那个文件或目录#include<jpeglib.h>compilationterminated.make:***[read.o]Error......
  • std::sort 传入成员函数指针报错的解决方案
    问题引入有一个类A,A的某个成员函数需要对A的某些变量进行std::sort,同时要调用A的另一个成员函数作为比较器。如代码所示:structA{vector<int>pos={0,4,2,5,3};boolcmp(intx,inty){returnpos[x]<pos[y];}voiddemo(){vector<int>a={2......
  • 奇数分辨率视频导出报错
    奇数分辨率的导出报错前记:有群u说了个冷知识,说ae里面mp4导出奇数分辨率会报错,我当时就当作个知识点来看待了。最近想起来这件事,就去了解查询了一下,发现是yuv编码还有输出本身的问题。我也只是浅入浅出,内容写的可能有点乱,见谅尝试验证阶段AE内置我用的是23sp版本,记得好像是23版......
  • 下载了powerpaste插件报错
    为什么我下载了powerpaste插件代码中写external_plugins:{powerpaste:"/static/tinymce/powerpaste/plugin.min.js"}然后就会报错tinymce.js:4759GEThttp://localhost:81/static/tinymce/powerpaste/plugin.min.jsnet::ERR_ABORTED404(NotFound)你遇到的问题可能......
  • springboot启动报错[main] o.a.catalina.core.AprLifecycleListener
    详细信息为:---[main]o.a.catalina.core.AprLifecycleListener:Anincompatibleversion[1.2.17]oftheApacheTomcatNativelibraryisinstalled,whileTomcatrequiresversion[1.2.34]解决方法:下载对应版本的native文件,地址为https://archive.apache......
  • 解决openavsa数据库报错的问题
    报错内容如图解决方法如下:卸载OpenVAS:$sudoapt-getremoveopenvas删除OpenVAS的所有依赖项:$sudoapt-getautoremove删除OpenVAS的所有配置文件:$sudorm-rf/etc/openvas/删除OpenVAS的所有数据:$sudorm-rf/var/lib/openvas/安装OpenVAS:$sudoapt-getinstallopenvas更......