debug
新奥尔良仙
仙女堡老大 ฅ۶•ﻌ•♡
展开
-
赋值b=a、浅拷贝copy.copy()、深拷贝copy.deepcopy(a)
赋值和拷贝原创 2022-07-31 22:56:14 · 291 阅读 · 0 评论 -
成功解决:Script file ‘D:\anaconda3\Scripts\pip-script.py‘ is not present
condainstallpip。原创 2022-07-27 14:43:51 · 1859 阅读 · 0 评论 -
成功解决:pydev debugger: warning: trying to add breakpoint to file that does not exist
在Run–> View Breakpoints里面,在调试这个文件的时候设置过断点,记录还在,把不需要的断点记录勾选掉就可以。原创 2022-07-07 09:37:42 · 3145 阅读 · 3 评论 -
【成功解决】XLRDError: Excel xlsx file; not supported
用pandas读取Excel文件时出现XLRDError: Excel xlsx file; not supported的问题。原创 2022-06-24 09:13:10 · 1279 阅读 · 0 评论 -
成功解决:Could not find a version that satisfies the requirement openpyxl (from versions: )
pip版本过低,需要更新pip:输入ps:pip和pip3的区别安装库openpyxl,pip3 install openpyxl或者pip install openpyxl:只是当一台电脑同时有多个版本的Python的时候,用pip3就可以自动区分用Python3来安装库。是为了避免和Python2发生冲突的。(2)如果你的电脑只安装了Python3,那么不管用pip还是pip3都一样的。安装了python3之后,会有pip3(1)使用pip install XXX :新安装的库会放在这个目录原创 2022-06-15 11:28:18 · 1940 阅读 · 0 评论 -
成功解决:pycharm中run不再是xxx.py,而是unittests in xxx.py
https://blog.csdn.net/weixin_43842949/article/details/124824984原创 2022-05-23 11:02:20 · 260 阅读 · 0 评论 -
成功解决:打开spyder过程中遇到Error: 5错误
去注册表把权限给关闭掉。win+R,输入regedit(注册表)找到HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System,修改这个路径下的键值:EnableLUA 从1 设置为0原创 2022-05-12 15:28:59 · 2201 阅读 · 0 评论 -
成功解决:Python 脚本运行时Segmentation fault (core dumped)
终端输入 ulimit -a,显示:stack size有限制,改成没有限制。终端输入 ulimit -S -s unlimited。终端输入 ulimit -a,显示:原创 2022-04-08 16:27:13 · 1137 阅读 · 1 评论 -
成功解决:RuntimeError: Expected object of scalar type Long but got scalar type Float for argument #2 ‘
代码如下:Loss = torch.nn.CrossEntropyLoss()loss = Loss(out, label)修改的时候,直接在label后面加上.long(),如下所示:Loss = torch.nn.CrossEntropyLoss()loss = Loss(out, label.long())原创 2022-03-13 21:35:40 · 1501 阅读 · 1 评论 -
成功解决: RuntimeError: No CUDA GPUs are available
打开设备管理器。右键禁用NVIDIA显卡,再启动。原创 2022-03-11 15:55:03 · 4214 阅读 · 1 评论 -
减少内存占用
原创 2022-03-01 21:52:30 · 92 阅读 · 0 评论 -
Linux学习之centos7的vim安装
用yum查找源中所有的VIM包。yum search vim已安装VIM的系统中查看VIM属于哪个软件包:which vimcd /usr/bin/vimrpm -qf /usr/bin/vim安装VIM:yum install vim-enhanced原创 2022-02-28 13:47:00 · 655 阅读 · 0 评论 -
Linux学习之centos 7 ping百度无法ping通
现象:在linux中ping www.baidu.com 无法ping通,但是ping百度的ip地址可以ping通。原因:DNS没配置好。解决方案:修改vi /etc/resolv.conf 增加如下内容:nameserver 114.114.114.114 (电信的DNS)nameserver 8.8.8.8(googel的DNS)就可以实现ping通外网了...原创 2022-02-28 13:44:43 · 991 阅读 · 0 评论 -
python如何安装faiss
python如何安装faiss原创 2022-02-08 22:14:37 · 2040 阅读 · 0 评论 -
def __init__、__enter__、__exit__、__del__在with下的表现
https://blog.csdn.net/qq_27884799/article/details/101535569原创 2022-02-02 11:35:53 · 555 阅读 · 0 评论 -
VSCode 返回上一个光标 (上一个浏览位置)
https://blog.csdn.net/M_N_N/article/details/84581840原创 2022-02-02 11:10:33 · 8730 阅读 · 0 评论 -
Linux 删除文件夹和文件的命令
-r (recursive):向下递归,不管有多少级目录,一并删除。删除之前,会有提示:是否删除。-f (force):就是直接强行删除,不作任何提示。删除文件夹实例:rm -rf /var/log/httpd/access将会删除/var/log/httpd/access目录以及其下所有文件、文件夹删除文件使用实例:rm -f /var/log/httpd/access.log将会强制删除/var/log/httpd/access.log这个文件...原创 2022-01-26 17:04:33 · 2558 阅读 · 0 评论 -
成功解决:计算交叉熵时, Dimension out of range
https://blog.csdn.net/a19990412/article/details/90349429原创 2022-01-26 16:57:36 · 585 阅读 · 0 评论 -
成功解决:计算交叉熵时, Dimension out of range
https://blog.csdn.net/a19990412/article/details/90349429原创 2022-01-04 17:02:35 · 284 阅读 · 0 评论 -
成功解决:计算交叉熵lossFunction报错“1D target tensor expected, multi-target not supported”的解决办法
https://blog.csdn.net/weixin_43429591/article/details/107047895原创 2022-01-04 17:02:03 · 1724 阅读 · 0 评论 -
成功解决:TypeError: super(type, obj): obj must be an instance or subt
改为super().__init__()原创 2021-12-26 21:45:07 · 2116 阅读 · 0 评论 -
成功解决:RuntimeError: DataLoader worker (pid(s) XXX) exited unexpectedly
num_workers是用来指定开多进程的数量,默认值为0,表示不启用多进程。将num_workers改为0即可,0是默认值。原创 2021-12-19 21:37:26 · 21884 阅读 · 6 评论 -
成功解决:无法定位程序输入点。。。。。 \torchvision\_C.pyd
原因:torch和torchvision版本不匹配原创 2021-12-18 20:46:45 · 2975 阅读 · 0 评论 -
Anaconda 镜像源配置
https://blog.csdn.net/qq_44721831/article/details/109840498?utm_medium=distribute.pc_relevant.none-task-blog-2defaultbaidujs_baidulandingword~default-2&spm=1001.2101.3001.4242.1原创 2021-12-12 11:46:07 · 824 阅读 · 0 评论 -
成功解决:ERROR: Cannot find command ‘git‘ - do you have ‘git‘ installed and in your PATH?
https://blog.csdn.net/qq_42075890/article/details/114013671原创 2021-12-09 22:44:30 · 10375 阅读 · 0 评论 -
vscode顶部显示当前文件完整路径信息
打开VScode文件 --> 首选项 --> 设置搜索 window.title将原来的值activeEditorShort 修改为 activeEditorLong原创 2021-12-08 17:31:44 · 2880 阅读 · 0 评论 -
交换数组维数
import numpy as nparr = np.arange(24).reshape((2,3,4))vc = arr.transpose(1,0,2)print(vc)>>>结果[[[ 0 1 2 3] [12 13 14 15]] [[ 4 5 6 7] [16 17 18 19]] [[ 8 9 10 11] [20 21 22 23]]]原创 2021-12-07 20:45:32 · 176 阅读 · 0 评论 -
成功解决:RuntimeError: size mismatch, m1: [1 x 8192], m2: [2048 x 1000]
原因:pytorch输入的大小固定为224*224,超过这个大小就会报错解决:image.resize([224, 224], Image.LANCZOS)原创 2021-12-06 18:31:49 · 3173 阅读 · 0 评论 -
将pip源更换到国内镜像的详细步骤(windows平台)
请移步去吮指原味张转载 2021-12-06 16:21:19 · 243 阅读 · 0 评论 -
vscode上更换镜像
pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple/原创 2021-12-06 16:07:39 · 3209 阅读 · 0 评论 -
成功解决。。。
https://blog.csdn.net/peng08303/article/details/105984561/原创 2021-12-03 17:12:41 · 85 阅读 · 0 评论 -
解决开机后浏览器没有网络问题
方法一:关机前关闭vpn方法二:搜索“网络状态”点击“代理”关闭“使用代理服务器”原创 2021-12-03 10:20:23 · 694 阅读 · 0 评论 -
NVIDIA驱动程序下载,查看cuda版本
打开网站点击搜索点击下载。原创 2021-12-02 20:28:20 · 228 阅读 · 0 评论 -
成功解决:把python 3.9降到python3.8
conda install python==3.8原创 2021-12-02 20:06:53 · 24867 阅读 · 0 评论 -
成功解决:python 矩阵转置
import numpy as npnp.transpose([list]) # 矩阵转置原创 2021-11-24 17:03:37 · 726 阅读 · 0 评论 -
成功解决:python列表转成字符串,同时自定义分隔符
from 刘贝斯a = ','mylist = ['Brazil', 'Russia', 'India', 'China']print(a.join(mylist))输出:Brazil,Russia,India,China原创 2021-11-20 22:48:39 · 721 阅读 · 1 评论 -
成功解决:Python数据类型转换——float64→float32
import numpy as npa = np.array([1,2,3,4,5,6,7,8,9],dtype='float64')c = a.astype(np.float32)原创 2021-11-20 21:47:32 · 10542 阅读 · 0 评论 -
成功解决:列表/数组长度不足自动补零0
li = [(0, 15, 33), (12, 15, 33), (17, 15, 33)]final_li = list(zip(*li))hour = list(final_li[0])minute = list(final_li[1])mode = list(final_li[2])hour = hour + [0] * (5- len(hour))minute = minute + [0] * (5 - len(minute))mode = mode + [0] * (5-原创 2021-11-20 21:45:48 · 1841 阅读 · 0 评论 -
成功解决 ImportError: cannot import name ‘logsumexp‘ from ‘scipy.misc‘
将程序中的:from scipy.misc import logsumexp改成:from scipy.special import logsumexp原创 2021-11-20 14:55:49 · 2258 阅读 · 0 评论 -
成功解决:Python读取字典内键值
dic = {'a':1,'b':2}dic.get('a')原创 2021-11-19 22:03:52 · 792 阅读 · 0 评论