
报错解决
各种错误的解决办法
鱼儿也有烦恼
本博客主要记录个人学习过程中的笔记,旨在分享学习旅程的精华与见解。
若有所助,幸甚;若有谬误,敬请斧正。
展开
-
Pycharm导入自定义模块报红
Pycharm 导入自定义模块报红,出现红色下划线。打开【File】->【Setting】->【Build,Execution,Deployment】->【Console】->【Python Console】,查看 Add Source Roots to PYTHONPATH 是否勾选,如果没有请勾选。选中波浪线标红的项目文件夹,右键,【Mark Directory as】–>【Sources Root】注意:一个项目下面如果有多个文件夹,我们只将最顶部的文件夹Sources Root 一下就可以了。原创 2024-05-07 18:04:32 · 2395 阅读 · 0 评论 -
from_pretrained()方法加载本地模型时报错:huggingface_hub.utils._validators.HFValidationError
在使用`from_pretrained()`方法加载本地预训练模型的权重时,发生下面的错误:huggingface_hub.utils._validators.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': '../../MMSA/pretrained_berts/bert_cn'. Use `repo_type` argument if needed.原创 2024-04-02 22:11:23 · 3712 阅读 · 2 评论 -
OSError: Can‘t load tokenizer for ‘bert-base-chinese‘
使用`from_pretrained()`函数从预训练的权重中加载模型时报错:OSError: Can't load tokenizer for 'bert-base-chinese'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name.原创 2024-04-02 21:53:24 · 12249 阅读 · 13 评论 -
Could not find a version that satisfies the requirement matplotlib (from versions: none)
Could not find a version that satisfies the requirement matplotlib (from versions: none)ERROR: Could not find a version that satisfies the requirement matplotlib (from versions: none)ERROR: No matching distribution found for matplotlib原创 2024-03-13 14:58:18 · 633 阅读 · 0 评论 -
ModuleNotFoundError No module named ‘config‘ 无法遍历到上一级目录文件
ModuleNotFoundError No module named 'config' 无法遍历到上一级目录文件。1.问题描述:无法遍历到上一级目录文件,导入config文件下面的python文件出错。2.解决办法:在导入语句前面加上以下代码:import os,sysparentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))sys.path.insert(0,parentdir)原创 2024-01-15 16:48:42 · 700 阅读 · 0 评论 -
PackagesNotFoundError The following packages are not available from current channels
解决conda安装包时,报PackagesNotFoundError的错误。在conda安装包的时候,在当前的通道(镜像)没有找到此安装包。到 anaconda 的官方源中进行下载。[https://anaconda.org](https://anaconda.org)原创 2024-01-15 11:41:38 · 1276 阅读 · 1 评论 -
桌面快捷方式变白解决办法
Windows10系统下,桌面快捷方式图标变为白块。产生原因:缓存在lconcache.db中的图标出现问题,只需要删掉后重建即可。原创 2023-11-07 20:26:23 · 2381 阅读 · 0 评论 -
No module named ‘cv2‘
1.报错信息。`ModuleNotFoundError: No module named 'cv2'`2.解决办法。报错没有cv2,但是需要安装的包是opencv。直接在对应的环境下安装opencv就可以了原创 2023-10-06 11:50:20 · 205 阅读 · 1 评论 -
运行%load_ext autoreload 和 %autoreload 2 出现以下错误解决办法
jupyter notebook中运行`%load_ext autoreload` 和 `%autoreload 2` 出现以下错误解决办法1.第一种错误`No module named 'autoreload #注释内容.........`原创 2023-07-22 18:03:03 · 1773 阅读 · 3 评论 -
解决AttributeError: module ‘scipy.ndimage‘ has no attribute ‘imread‘报错
报错原因是因为,imread 已弃用!imread 在 SciPy 1.0.0 中已弃用,并将在 1.2.0 中删除。综合应用如下:(代码因为你们没有模型运行不了,重在看思想,看新版本的代码如何使用,然后应用到自己的代码上)原创 2023-08-03 19:02:37 · 1356 阅读 · 0 评论