![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
追梦小狂魔
只要相信自己就没有什么不做不到
展开
-
京东检测补货
windows下,检测到了喇叭响。原创 2023-04-03 19:38:37 · 536 阅读 · 0 评论 -
gunicorn不能print
加flush=True。原创 2023-02-18 09:18:22 · 195 阅读 · 0 评论 -
SyntaxError: Non-UTF-8 code starting with ‘\xf0‘ in file D:/csa/未知字符.py on line 15, but no encoding
【代码】SyntaxError: Non-UTF-8 code starting with '\xf0' in file D:/csa/未知字符.py on line 15, but no encoding。原创 2023-02-17 19:32:18 · 111 阅读 · 0 评论 -
ubuntu一键配置深度学习环境
ubuntu18.04和20.04测试通过。jupyter不太好用,下面说一下我的配置。原创 2023-02-16 17:59:24 · 199 阅读 · 0 评论 -
RuntimeError: The Session graph is empty. Add operations to the graph before calling run().
【代码】RuntimeError: The Session graph is empty. Add operations to the graph before calling run().原创 2023-02-14 10:53:47 · 73 阅读 · 0 评论 -
获取savemodel的输入输出节点
【代码】获取savemodel的输入输出节点。原创 2023-02-14 07:25:07 · 259 阅读 · 0 评论 -
ubuntu更改默认的conda环境
在bashrc中的,#原创 2023-01-27 17:13:40 · 779 阅读 · 0 评论 -
pytorch 固定随机种子
【代码】pytorch 固定随机种子。原创 2023-01-25 20:15:57 · 514 阅读 · 0 评论 -
python opencv base64和cv2之间互转+tensor
【代码】python opencv base64和cv2之间互转+tensor。原创 2022-12-30 18:54:34 · 592 阅读 · 0 评论 -
python使用opencv统计图片数据集的均值mean和方差std
【代码】python使用opencv统计图片数据集的均值mean和方差std。原创 2022-12-29 14:36:42 · 848 阅读 · 0 评论 -
pytorch单机多卡设置在哪个显卡上跑
pytorch设置在哪个显卡上跑。开头加上,直接复制就行了,没引号。原创 2022-11-10 19:09:23 · 415 阅读 · 0 评论 -
ModuleNotFoundError: No module named ‘_lzma‘
解决_lzma问题原创 2022-11-05 18:36:38 · 632 阅读 · 0 评论 -
centos一键安装python3.7
【代码】centos一键安装python3.7原创 2022-11-05 17:45:04 · 240 阅读 · 0 评论 -
git pull免密
【代码】git pull免密。原创 2022-10-31 19:19:21 · 1022 阅读 · 0 评论 -
【Pytorch错误】RuntimeError: received 0 items of ancdata
最前面加一句,理论上加载文件之前加就行了。原创 2022-10-27 21:59:21 · 211 阅读 · 0 评论 -
进阶版启动jupyterlab教程
【代码】进阶版启动jupyterlab教程。原创 2022-10-27 15:58:57 · 739 阅读 · 0 评论 -
python requests post 中文结果请求得到unicode
【代码】python requests post 中文结果请求得到unicode。原创 2022-10-04 21:22:15 · 1089 阅读 · 0 评论 -
python报错 ‘utf-8‘ codec can‘t encode characters in position xxxx-xxxx: surrogates not allowed
如果设置为xmlcharrefreplace,则使用XML的字符引用。如果设置为replace,则会用?如果设置为ignore,则会忽略非法字符;原创 2022-07-19 18:42:06 · 1090 阅读 · 0 评论 -
python 使用filetype校验文件
代码】python使用filetype校验文件。原创 2022-07-18 20:31:03 · 478 阅读 · 0 评论 -
windows远程查看tensorboard
在tensorboard文件夹的上一级文件夹运行tensorboard --logdir=./runs --port=6123然后本地cmd命令行(用户名@IP是ssh的)ssh 用户名@IP -L 8123:127.0.0.1:6123然后就可以本地访问8123端口了原创 2022-07-13 16:40:01 · 251 阅读 · 1 评论 -
github最快pr方式
git 快速pr原创 2022-06-30 07:25:49 · 156 阅读 · 0 评论 -
yolox出现 RuntimeError: DataLoader worker (pid(s) 17724, 1364, 18928) exited unexpectedly
yolox出现RuntimeError: DataLoader worker (pid(s) 17724, 1364, 18928) exited unexpectedly原创 2022-06-28 12:26:20 · 667 阅读 · 0 评论 -
NotImplementedError: Could not run torchvision::nms
NotImplementedError: Could not run torchvision::nms原创 2022-06-27 20:42:00 · 635 阅读 · 0 评论 -
python将视频转为图片
python将视频转为图片原创 2022-06-24 12:21:52 · 1627 阅读 · 1 评论 -
python自定义的包无法导入
import sysdir_mytest = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))sys.path.insert(0, dir_mytest)调用父级目录下的asd在test2中加入上面的代码,首先最好是有__init__.py原创 2022-05-27 21:09:36 · 568 阅读 · 1 评论 -
ubuntu安装pillow报错
如下指令报错pip3 install pillow使用下方安装依赖在安装pillowsudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-devpip3 install pillow原创 2022-05-26 09:20:19 · 512 阅读 · 0 评论 -
ubuntu18.04安装jupyter
用sudo权限全部安装,不然还得设置环境变量sudo -i生成jupyter notebook配置文件jupyter notebook --generate-configipythonfrom notebook.auth import passwdpasswd()#两次输入密码这里会得到一串字符,保存下来很重要vim ~/.jupyter/jupyter_notebook_config.pyvim修改,打开按i然后再最后输入下面代码# 在文件末尾添加c.NotebookAp原创 2022-05-25 22:10:37 · 1338 阅读 · 0 评论 -
Centos7找不到pyconfig.h
sudo yum -y install python36-devel原创 2022-05-25 17:29:01 · 165 阅读 · 0 评论 -
pip 安装opencv-python卡死
如图安装的时候卡死了pip3 install --upgrade pip升级一下然后轻松解决原创 2022-05-11 20:23:38 · 1203 阅读 · 1 评论 -
python binascii.Error: Incorrect padding
删除前半部分str(res).split(",")[1]只要后半部分就可以了原创 2022-05-10 23:14:56 · 453 阅读 · 0 评论 -
pip设置默认清华源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple原创 2022-05-09 09:56:11 · 689 阅读 · 0 评论 -
win10安装setup.py
建议先创建虚拟环境python setup.py build python setup.py install原创 2022-05-09 09:55:23 · 586 阅读 · 0 评论 -
win10安装setup.py
建议先创建虚拟环境python setup.py build python setup.py install原创 2022-05-06 21:00:15 · 580 阅读 · 0 评论 -
w10 下third-party dynamic library (cudnn64_7.dll) that Paddle depends on is not configured correctly.
paddl出了问题我的版本是cudnn-10.2-windows10-x64-v7.6.5.32本地配置好了cuda 因为pytorch是可以用的,所以我确定没问题下载压缩包bin文件夹将这个文件解压到C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2验证代码import paddle.fluidprint(paddle.utils.run_check())...原创 2022-04-28 13:05:00 · 1688 阅读 · 0 评论 -
BrokenPipeError: [Errno 32] Broken pipe
这个问题通常是在windows下出现的,可以吧num_works改到0以yolox为例在yolox_base.py的32行 num_workers=0不怕麻烦的也可以逐渐寻找最佳参数 0 2 4 8 16 出错了就不要加了原创 2022-04-21 15:10:35 · 229 阅读 · 0 评论 -
pywin32转换格式表
open(r'c:\text','r')wdFormatDocument = 0wdFormatDocument97 = 0wdFormatDocumentDefault = 16wdFormatDOSText = 4 # .txtwdFormatDOSTextLineBreaks = 5wdFormatEncodedText = 7wdFormatFilteredHTML = 10 # .htmlwdFormatFlatXML = 19wdFormatFlatXMLMacroEna原创 2022-04-03 18:49:34 · 124 阅读 · 0 评论 -
pycharm打印不全问题
idea.max.intellisense.filesize = 20000idea.max.content.load.filesize = 20000idea.cycle.buffer.size = 20000还打印不出来就继续加零原创 2022-03-03 12:35:50 · 866 阅读 · 0 评论 -
torch.load AttributeError: Can‘t get attributet
出现这个问题是因为直接使用了torch.load没有导入相应的模型文件from mymodels import *导入定义模型的py文件即可原创 2022-02-18 10:39:51 · 1829 阅读 · 0 评论 -
stack expects each tensor to be equal size, but got [3, 40, 160] at entry 0 and [4, 40, 160] at entr
这个问题是通道数不一样导致的,本质上是图像的问题加载图像时加上.convert(‘RGB’)即可data = Image.open(imgPath).convert('RGB')原创 2022-02-11 10:23:53 · 1279 阅读 · 0 评论 -
python 文件类型检测 linux和windows都可以用
import filetype as ftypefilename="1.docx"print(ftype.guess(filename).mime)网址https://github.com/h2non/filetype.pyImagedwg - image/vnd.dwgxcf - image/x-xcfjpg - image/jpegjpx - image/jpxpng - image/pnggif - image/gifwebp - image/webpcr2 - image原创 2022-01-21 13:51:15 · 233 阅读 · 0 评论