07 2021 档案
python yield
摘要:import time def func_y(data): time.sleep(data) return data * 2 def get_num(a): """ 普通return 函数 """ for i in range(a): return func_y(i) def get_num2(a)
阅读全文
np.isnan 报错
摘要:报错如下 TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely 解决办法 将 np.isnan 换成 pd.isna
阅读全文
python中的pyi
摘要:本文值代表个人见解,若有不当之处,希望大家指出。 a.pyi文件可以对a.py文件中的数据类型进行指定, 指定以后,如果调用数据类型不规范,会报错。 比如a.py文件内容如下: def greeting(name): # 注意此处未指定数据类型 return "Hello" + name a.pyi
阅读全文
生成项目目录结构树
摘要:都是在命令行使用tree命令,但是windows和linux的命令参数有区别 windows 命令参数很少,只有 /f 和 /A 两个参数 tree /f ./ > tree.txt # 生成结构(包括所有文件)到 tree.txt tree > tree.txt # 只生成文件夹(不包含文件)的结
阅读全文
Failed to get convolution algorithm. This is probably because cuDNN failed to initialize
摘要:出现这个错误的配置是: 1、tensorflow-gpu==1.13 + tensorflow-probability == 0.6.0 2、cuda10.0 3、cudnn-7.4.2 4、ubuntu16.04 后降低版本: 1、tensorflow-gpu==1.12 + tensorflow
阅读全文
windows pip is configured with locations that require TLS/SSL, however the ssl module in Python i...
摘要:原因 Anaconda 环境变量未配置完全 解决办法 需要配置的环境变量: D:\ProgramData\Anaconda3 D:\ProgramData\Anaconda3\Scripts D:\ProgramData\Anaconda3\Library\bin 参考链接
阅读全文
python opencv cv2打开中文路径图片报错:cv2.error: OpenCV(4.5.1) ..\modules\imgproc\src\color.cpp:182: error
摘要:报错如下 Traceback (most recent call last): File "D:\Users\Admin\Anaconda3\envs\tf1\lib\site-packages\IPython\core\interactiveshell.py", line 3437, in run
阅读全文
dlib安装-CPU-GPU
摘要:conda安装 conda install dlib # cpu版本 编译安装 CPU版本 下载链接:http://dlib.net/files/ 注意:python和dlib有版本兼容问题,需要下载兼容的版本,不然安装会报错 安装cmake: pip install cmake 下载后,解压,进入
阅读全文
git bash执行python命令行无反应
摘要:现象 在git bash查看python环境,python版本都没有问题,但是输入python进入命令行会卡住 原因 在安装时候选择了MinTTY模式,其默认不支持交互操作 解决办法 使用命令:winpty python 正常进入命令行交互模式 其他报错 若输入 winpty python出现 st
阅读全文
windows git配置
摘要:报错一 ## 报错代码: #1.情况1 unable to execute file code740 #2.情况2 This problem is probably due to using incompatible versions of the cygwin DLL. Search for cy
阅读全文
CMake must be installed to build the following extensions: dlib
摘要:安装 python face_recognition模块时报错 解决办法: pip3 install cmake
阅读全文
浙公网安备 33010602011771号