
常见问题
文章平均质量分 60
szZack
写一点过往的积累。
展开
-
TypeError: MessageToJson() got an unexpected keyword argument including_default_value_fields
TypeError: MessageToJson() got an unexpected keyword argument including_default_value_fields原创 2024-10-22 13:55:13 · 755 阅读 · 1 评论 -
OCI runtime create failed: container_linux.go:345: starting container process caused “exec: \“pip\“
解决:OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"pip\"原创 2023-08-15 16:27:31 · 1627 阅读 · 0 评论 -
TypeError: 921 is not JSON serializable
TypeError: 921 is not JSON serializable原创 2023-01-13 15:42:08 · 227 阅读 · 0 评论 -
python3实现cv2+numpy裁剪不规则四边形图片
python3 裁剪不规则四边形图片原创 2023-01-05 10:36:08 · 1267 阅读 · 0 评论 -
解决 WARNING: Published ports are discarded when using host network mode 问题
WARNING: Published ports are discarded when using host network mode原创 2022-10-09 14:39:06 · 20294 阅读 · 0 评论 -
docker mysql “ERROR 2002(HY000):Can‘t connect to local MySQL server through socket,mysql容器不断重启”处理方法
docker mysql “ERROR 2002(HY000):Can’t connect to local MySQL server through socket,mysql容器不断重启原创 2022-10-03 00:30:00 · 3933 阅读 · 1 评论 -
Ubuntu离线安装nvidia-docker完整过程(最简单的解决方法解决nvidia-docker: command not found/Unknown runtime specified)
nvidia-docker原创 2022-10-01 00:30:00 · 11141 阅读 · 7 评论 -
宿主机可以ping外网,docker容器内无法ping外网;宿主机可以用wget下载,docker容器内无法用wget下载
宿主机可以ping外网,docker容器内无法ping外网;宿主机可以用wget下载,docker容器内无法用wget下载原创 2022-09-07 08:18:06 · 1757 阅读 · 1 评论 -
Linux服务器离线安装Flask
Linux服务器离线安装Flask原创 2022-08-31 16:08:15 · 2068 阅读 · 0 评论 -
Ubuntu下pip install cartopy报错完整可行解决方案
Linux安装cartopy原创 2022-08-23 19:20:27 · 2908 阅读 · 0 评论 -
已知点的经纬度坐标计算/读取DEM高程信息/海拔高度
经纬度坐标计算/读取DEM高程信息/海拔高度原创 2022-08-10 11:14:22 · 3781 阅读 · 3 评论 -
‘latin-1‘ codec can‘t encode characters in position 103-115: Body (‘一串中文‘) is not valid Latin-1
'latin-1' codec can't encode characters in position 103-115: Body ('一串中文xxx') is not valid Latin-1. Use body.encode('utf-8') if you want to send it encoded in UTF-8.原创 2022-06-21 20:45:00 · 6505 阅读 · 0 评论 -
bash: scp: command not found
scp异常原创 2022-05-11 09:10:25 · 5398 阅读 · 0 评论 -
ImportError: No module named ‘sklearn‘
运行环境python3.5错误ImportError: No module named ‘sklearn’解决方法pip3 install scikit-learn==0.22原创 2022-05-09 10:51:26 · 1499 阅读 · 0 评论 -
TypeError: ufunc ‘isinf‘ not supported for the input types, and the inputs could not be safely...
报错代码np.isinf(Table)nmupy错误提示:TypeError: ufunc ‘isinf’ not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ‘‘safe’’原因Table 数据中存在非数值型的数据,比如str解决方法删除Table数据中的非数值型数据..原创 2022-05-07 17:38:21 · 10580 阅读 · 0 评论 -
解决selenium.common.exceptions.SessionNotCreatedException:ChromeDriver only supports Chrome version 77
环境Ubuntu 16.04 LTSpython 3.x 报错信息:使用 Chrome 浏览器运行Web自动化测试报错,信息如下:Traceback (most recent call last): File "click_csdn_chromedriver.py", line 80, in <module> click_web(main_page_url)...原创 2020-05-09 20:06:35 · 1468 阅读 · 0 评论 -
正解python3 json报错:from None json.decoder.JSONDecodeError: Expecting value: line 1 column 6 (char 5)
环境Ubuntu 16.04 LTSpython3.x问题描述从字符串转换为json对象时,报错如下:Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.5/json/__init__.py", line 319...原创 2020-04-11 09:47:52 · 5502 阅读 · 0 评论 -
AI工具:Windows7 32位操作系统安装PyCharm报错及interpreter field is empty错误的解决方案
Windows7 32位操作系统安装PyCharm报错Windows7 32Bit 安装 64 Bit Pycharm on Windows 7报错only support 64 bit解决方法1、下载32位PyCharm安装程序下载页面链接 点击我下载的是“Version 2018.3”中的“PyCharm Community Edition”的“2018.3.7 for Wi...原创 2020-03-07 09:06:45 · 1027 阅读 · 0 评论 -
pip使用清华源(tsinghua)秒速安装TensorFlow 2.1.0 GPU版
环境Ubuntu 16.04python3.x秒速安装tensorflow GPU版本比如我们安装1.13.1 gpu版:pip install tensorflow-gpu==1.13.1 -i https://pypi.tuna.tsinghua.edu.cn/simple同理,安装tensorflow 2.1.0 gpu版:pip install tensorf...原创 2020-01-11 17:30:15 · 16046 阅读 · 0 评论 -
解决: ImportError:No module Named 'Cython'
环境ubuntu 16.04python3.5问题错误提示:ImportError:No module Named 'Cython'解决方法pip install Cython原创 2020-01-06 20:09:20 · 8121 阅读 · 0 评论 -
解决:ImportError:No module Named 'fdfs_client'
环境ubuntu 16.04python3.5问题错误提示:ImportError:No module Named ‘fdfs_client’解决方法pip install py3Fdfs原创 2020-01-06 20:06:04 · 3014 阅读 · 2 评论 -
pip使用清华源秒速安装skimage、opencv、tensorflow等python库
秒速安装命令:pip install scikit-image -i https://pypi.tuna.tsinghua.edu.cn/simplepip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple-i 后面的参数是源链接,这里选择的是清华源,下载速度超过 5 M/S清华源链接:https://...原创 2020-01-03 21:41:17 · 10048 阅读 · 1 评论 -
Ubuntu16.04 中 pip 使用清华源快速安装 pytorch 0.4.1
环境Ubuntu 16.04python3.x总结了几种pip安装 pytorch 0.4.1 的方法:方法1pip直接安装pip install torch==0.4.1缺点:下载速度特别慢,而且可能中断,然后又得重新下载方法2pip 使用清华源快速安装 pytorch 0.4.1pip install torch==0.4.1 -i https://pypi....原创 2019-12-04 20:35:53 · 3271 阅读 · 1 评论 -
gt_argmax_overlaps=overlaps.argmax(axis=0) ValueError: attempt to get argmax of an empty sequence
问题描述用 Faster-RCNN 训练检测模型时,训练到中间过程报如下错误:gt_argmax_overlaps = overlaps.argmax(axis=0) ValueError: attempt to get argmax of an empty sequence解决方法写一段代码检查数据问题,可能的问题包括:1、生成了 xml 标注文件,但标注数量为空2、检测 x...原创 2019-11-28 20:35:49 · 2676 阅读 · 0 评论 -
from tqdm import auto as tqdm_lib ImportError: cannot import name 'auto'
问题描述:import tensorflow_datasets 时报错:Traceback (most recent call last):File “transfer_learning_resnet101.py”, line 25, in import tensorflow_datasets as tfdsFile “/home/zzh/data/dev/virtualenv/py3e...原创 2019-11-23 11:25:10 · 1909 阅读 · 1 评论 -
ps、grep、awk、kill组合使用快速批量kill进程
任务:找到所有chrome进程,并kill掉shell脚本:ps -ef| grep chrome |grep -v grep |awk '{print $2}' | xargs kill -9解释:ps -ef| grep chrome |grep -v grep查找所有包括chrome的进程,形如:test 26375 14591 0 09:07 pts/0 ...原创 2019-10-19 09:17:45 · 1888 阅读 · 0 评论 -
正确解决cp:cannot stat xxx no such file or directory
记录一个奇怪的问题问题描述执行shell脚本到如下命令时报错:cp:cannot stat xxx no such file or directorycp -r $data"_"$i"/*" $train_data问题分析1、 $data"_"$i"/*" 是否存在,查看了下路径确实存在2、是否有权限,查看了下有权限解决方法1、将上述脚本修改一下tmp_dir...原创 2019-10-11 22:00:43 · 113563 阅读 · 4 评论 -
处理python3爬虫问题:urlopen error [Errno 111] Connection refused 或 urlopen error timed out
问题爬虫时使用代理,经常会出现 <urlopen error [Errno 111] Connection refused> 或者 这类的错误,造成这类问题的原因是代理ip不可用或者质量差,解决方法如下:方法1、建立代理ip池2、使用try… except… 处理异常,删除无效ip,示例代码:def crawl_web_data(url, proxy_ip_list):...原创 2019-07-28 13:30:35 · 11192 阅读 · 0 评论 -
AI实战:docker中用TensorBroad可视化模型训练过程
前言TensorBoard是TensorFlow自带的一个强大的可视化工具,目前支持7种可视化,Scalars, Images, Audio, Graphs, Distributions, Histograms 和 Embeddings 。主要功能如下:(1)Scalars:展示训练过程中的准确率、损失值、权重/偏置的变化情况。(2)Images:展示训练过程中记录的图像。(3)Audi...原创 2019-08-04 09:52:56 · 4119 阅读 · 0 评论 -
TensorFlow版本与CUDA、cuDNN、python、GCC版本对应关系
这里记录下不同TensorFlow版本与CUDA、cuDNN、python、GCC版本对应关系。Which TensorFlow and CUDA version combinations are compatible?Linux-GPU:- Linux (CPU版本)- macOS GPUmacOS (CPU)Windows...原创 2019-07-29 18:27:20 · 3725 阅读 · 0 评论 -
python踩坑系列:赋值、拷贝、深拷贝
python踩坑系列:=赋值、拷贝、深拷贝对于比较复杂的数据进行赋值时,需要小心一些坑,下面看一些具体例子(测试环境: python3)import os, sys, copyprint('赋值')a = [[(1,2), (300,200)], 'dog']print('a=', a)b = aprint('b=', b)a[1] = 'cat'print('a='...原创 2019-07-20 08:20:50 · 2149 阅读 · 0 评论 -
python踩坑系列:sorted
python踩坑系列:sorted语法sorted 语法:sorted(iterable, key=None, reverse=False)参数说明:iterable: 可迭代对象。key: 主要是用来进行比较的元素,只有一个参数,具体的函数的参数就是取自于可迭代对象中,指定可迭代对象中的一个元素来进行排序。reverse: 排序规则,reverse = True 降序 , ...原创 2019-07-20 08:20:12 · 2118 阅读 · 0 评论 -
解决django的No module named 'django.urls' 错误
问题描述使用django搭建web服务时,运行python manage.py runserver后出现 No module named ‘django.urls’ 错误环境:python3.5Django==1.10原始代码:from django.conf.urls import patterns, include, urlfrom image.views im...原创 2019-07-07 08:33:22 · 12882 阅读 · 0 评论 -
python3序列化、反序列化,字符串、byte、数据结构/对象互相转换
环境Ubuntu16.04python 3.x序列化、反序列化将复杂的‘数据结构/对象’序列化、反序列化import pickleimport base64import jsona = [[1, ['a']], [2, ['a', 'c']], [3, ['d']], [4, ['b']]] #可以是图像cv2的image的对象,或者组合的更复杂的数据结构#复杂结构/对...原创 2019-07-10 22:09:05 · 6922 阅读 · 0 评论 -
用tensorflow快速创建语料库词汇索引的方法
前言在写 快速搭建垃圾分类智能问答机器人 时,发现使用词向量训练模型准确率仅有80左右,考虑了几点问题:一是数字类、英文类的词没有对应的词向量;二是训练语料太少了(百级),导致词向量优势体现不出来。故增加一种词索引的表示方法。下面介绍用tensorflow快速创建语料库词汇索引的方法用tensorflow快速创建语料库词汇索引功能建立词汇表和word到index,及index到wor...原创 2019-07-08 20:55:12 · 5067 阅读 · 1 评论