- 博客(52)
- 收藏
- 关注
原创 pyqt5------ plugin windows
错误原因:This application failed to start because it could not find or loadthe Qt plugin windows重新安装:pyqt5即可
2019-10-17 15:53:21 533
原创 访问网页,图片出现403问题
发生的问题:访问网页,但是并不出现图片,查看network后显示访问的图片状态为403,但是这个图片地址直接复制出来在地址栏打开,却是看得到的。解决办法:在HTML代码的head中添加一句<meta name="referrer" content="no-referrer" />即可亲测有效参考:https://www.jianshu.com/p/56df...
2019-09-27 23:27:40 657
原创 UserWarning: torch.range is deprecated in favor of torch.arange and will be removed in 0.5.
报错信息:UserWarning: torch.range is deprecated in favor of torch.arange and will be removed in 0.5. Note that arange generates values in [start; end), not [start; end].就是说,我们现在用的torch.range(0,m)得到的结...
2019-03-22 19:13:46 3108
原创 ImportError: No module named 'warpctc_pytorch._warp_ctc.__warp_ctc'
emmmmm!终于解决了!请确保问题是 你在操作 warp-ctc 出错!问题原因:在上篇博客中,本以为,创建test.py进行验证,即可安装成功!没想到,在实际环境中,使用 from warpctc_pytorch import CTCLoss ,会出现一系列错误!问题及路程:ImportError: No module named 'warpctc_pytorch’...
2019-03-22 09:38:18 4879
原创 src/binding.cpp:6:29: fatal error: torch/extension.h: 没有那个文件或目录
error: command ‘gcc’ failed with exit status 1warp-ctc请确保你是在进行 warp-ctc 下的python setup.py install出现的报错!解决方案:终端输入命令后git checkout ac045b6072b9bc3454fb9f9f17674f0d59373789之后再运行命令:python setup...
2019-03-20 15:28:03 3994
原创 symbol lookup error: undefined symbol:PySlice_Unpack
报错信息:symbol lookup error:xxx/lib/python3.6/site-packages/torch/lib/libtorch_python.so: undefined symbol: PySlice_Unpack暂时未解决= =!不过查看 看到有人解决:多半是版本问题,需要重新安装一边pytorch,torchvision-----------...
2019-03-17 09:42:26 7868 7
原创 Non-UTF-8 code starting with '\xe7'
意思是不认识这个字:虽然现在使用python3 不用在文件的开头加上# -*- coding:utf-8 -*-但是 加上后,即可解决报错问题
2019-03-13 08:44:01 329
原创 PIL 对图片进行添加汉字
draw = ImageDraw.Draw(img)# 加载字体font = ImageFont.truetype('./font_simsun/simsun.ttc', 24)(x1, y1)=(100,300) # 写入图片的坐标位置str_hinese=‘加油!’rgb=(255,0,0)# 进行中文文本写入draw.text((x1, y1), str_hinese...
2019-03-04 09:27:20 1139 1
原创 invalid argument 2 pytorch
报错信息:RuntimeError: invalid argument 2: size '[224 x 224 x 3]' is invalid for input with 200704 elements at /pytorch/aten/src/TH/THStorage.cpp:84由于224*224*3=150528224*224*4=200704所以发现问题所在就是 读取...
2019-03-02 09:02:40 1762
原创 Implicit dimension choice for softmax has been deprecated. yolo
警告信息:UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argumentnn.Softmax()函数已经被弃用了,虽然程序还是可以运行成功,但是这个做法不被pytorch所赞成。这个写法在早期的pytorch版本...
2019-03-01 20:23:57 780
原创 Pytorch TypeError: batch must contain tensors, numbers, dicts or lists
错误原因: TypeError: batch must contain tensors, numbers, dicts or lists; found <U1 首先通过transform 将你的例如 图片 的数据 转化为tensor类型再运行,发现是错误的,查看错误代码的行数发现 <u1 这个是numpy里的一个dtype类型,虽然不知道这个类型是什么,...
2019-02-04 17:22:53 12737 1
原创 数据分析与挖掘知识点-1
train[col].nunique() 统计(该列有多少个不相同的数据)相加train[col].isnull().sum() 处理缺失值 将列中为空的个数统计出来train[col].value_counts(normalize=False, sort=True, ascending=False, bins=None, dropna=True) 可以对Series里面的每个值进行计...
2019-01-12 09:53:29 411
原创 图像小知识点总结-1
一. PIL Numpy 转换image = Image.fromarray(image, "RGB") # 把numpy数组 转化为PILimage = np.asarray(image) # 把PIL 转为 numpy 二. Image.resize(size,resample =NEAREST) 默认NEARESTresample - 可选的重采样过滤器。这...
2019-01-08 23:39:34 464
原创 backward的 retain_variables=True与retain_graph=True 区别及应用
首先 :retain_variables=True 与 retain_graph=True 没有任何区别 只是 retain_variables 会在pytorch 新版本中被取消掉,将使用 retain_graph 。 所以 在使用 retain_variables=True 时报错: TypeError: backward() got...
2019-01-05 22:24:54 9886
原创 训练中动态调整学习率lr,optimizer.param_groups
四、在训练中动态的调整学习率 1 2 3 4 5 6 7 8 9 '''调整学习率''' # 新建optimizer或者修改optimizer.params_groups对应的学习率 # # 新建optimizer更简单也更推荐,optimizer十分轻量级,所以开销很小 ...
2019-01-05 18:40:37 25528
原创 pytorch cpu与gpu load时相互转化 torch.load(map_location=)
pytorch将cpu训练好的模型参数load到gpu上,或者gpu->cpu上假设我们只保存了模型的参数(model.state_dict())到文件名为modelparameters.pth, model = Net()1. cpu -> cpu或者gpu -> gpu:checkpoint = torch.load('modelparameters.pth')...
2019-01-02 16:41:36 33042
原创 nn.ReflectionPad2d()
ReflectionPad2d() 类似于一种 镜像填充 说说公式,及属性 具体官方文档很详细 不过不够通俗= = 官方文档上 是这个 表示第一眼 有点不理解= = 但是输出是 H(out) = H(in) + paddingTop + paddingBottomW(out) = W(in) + paddingLeft + paddi...
2018-12-20 19:31:00 16039 4
原创 pytorch loss 损失函数
常用的 loss 损失函数nn.MSELoss 均方损失函数 nn.BCELoss 二分类用的交叉熵 nn.CrossEntropyLoss 多分类用的交叉熵损失函数 还有更多的损失函数 推荐阅读 https://blog.csdn.net/zhangxb35/article/details/72464152 ...
2018-12-09 17:19:02 1072
原创 torch.cat()使用
百度一下发现 网上给的列子 也太low了= =自己写了个 省得忘了batch_size=3x = torch.randn(batch_size).unsqueeze(1)result_0=torch.cat([x**i for i in range(1,4)],0)result_1=torch.cat([x**i for i in range(1,4)],1)print(...
2018-12-02 11:18:35 1912
原创 pymysql 远程连接 mysql 数据库
由于需要,想要在 windows上连接 ubuntu 上 mysql建议参考https://blog.csdn.net/wangshuminjava/article/details/79310086https://blog.csdn.net/qq_42747264/article/details/82557099这两篇文章 如果连接还是不成功,按照下面输入 应该会可以你想my...
2018-11-30 03:14:51 3432
原创 ubuntu windows cpu pip 安装 pytorch
在安装pytorch之前 看到网上一堆 教程 什么 cuda 什么 anaconda繁琐= = 简单点 CPU ubuntu Pytorch 或者 CPU windows Pytorch 安装过程 直接官网首页 说的明明白白 只需要点击自己想要的 stable 稳定版linuxpippython3.5cuda:...
2018-11-28 13:28:05 585
原创 linux mysql----You have an error in your SQL syntax; check the manual that corresponds to your MySQL
Mysql 语句毛病(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'nulluser_id varchar(20) not null,foreign key(...
2018-11-21 21:11:06 1546
原创 ubuntu 安装 mysql
1.首先查看是否安装过 mysql 终端输入: sudo netstat -tap | grep mysql 没反应 则没有安装 有出现东西 表示安装 2.没有安装的话 输入 sudo apt-get install mysql-server mysql-client 进行安装 3.中途会输入 数据库密码 按照提示输入就行 4.检...
2018-11-19 23:09:06 145
原创 Ubuntu 安装 Anaconda3
bash Anaconda3-4.2.0-Linux-x86_64.sh根据相应回车 yes等完成后打开一个新的命令行窗口 查看是否安装成功anaconda -Vconda -V启动ipython notebook参考链接https://blog.csdn.net/u012318074/article/details/77074665...
2018-11-18 09:52:08 150 2
原创 Key Variable not found in checkpoint [[{{node save/RestoreV2}} = RestoreV2[dtypes=
报错信息: 一堆 挑了几个重要的tensorflow.python.framework.errors_impl.NotFoundError: Key Variable not found in checkpoint [[{{node save/RestoreV2}} = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT], _device="/job:lo...
2018-11-13 23:54:50 7334 8
原创 TypeError: The value of a feed cannot be a tf.Tensor object.
在进行占位符时 遇到这个问题 TypeError: The value of a feed cannot be a tf.Tensor object. Acceptable feed values include Python scalars, strings, lists, numpy ndarrays, or TensorHandles.For reference, the ten...
2018-11-13 20:14:21 2230 1
原创 tensorflow.python.framework.errors_impl.OutOfRangeError: FIFOQueue
这个错误 服了错误原因:tensorflow.python.framework.errors_impl.OutOfRangeError: FIFOQueue '_2_batch/fifo_queue' is closed and has insufficient elements (requested 2800, current size 0) [[{{node batch}} ...
2018-11-11 23:55:47 706
原创 WARNING:tensorflow: Instructions for updating Please use xxxxxxx
是我看得学习 tf 视频有点旧了 还是人家 tf 版本更新太快了一直给我 红色警告 千奇百怪的 而且不知道怎么解决 很烦不过找到了一个 很不错的方法 再到入包的下面添加这3句话即可import tensorflow as tfold_v = tf.logging.get_verbosity()tf.logging.set_verbosity(tf.logging.ER...
2018-11-08 22:41:56 8955 6
原创 with tf.Session as sess: AttributeError: __exit__
一个小错误 ,不过以后会记住的 with tf.Session as sess:AttributeError: __exit__ 错误原因 在Session后加Session()with tf.Session as sess:修改成下面就好with tf.Session() as sess:...
2018-11-04 09:39:26 1931 1
原创 Reshape your data either using array.reshape(-1, 1)
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.版本原因 sklearn 0.19版本 0.18版本一维二维都可以将代码里所...
2018-10-28 15:46:06 4870
原创 global_variables_initializer
Instructions for updating:Use `tf.global_variables_initializer` instead. initialize_all_variables已被弃用使用tf.global_variables_initializer代替。修改下代码就好了
2018-10-07 09:56:23 949
原创 Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
Tensorflow 的运行 会提示一行红字大概意思就是 这个Tensorflow 不能支持几种CPU矢量运算的指令码 添加2行代码import osos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'即可解决...
2018-10-07 09:26:38 124
原创 Cache entry deserialization failed, entry ignored
在anaconda上安装 东西提示 权限不够 用管理员身份打开 Anaconda Prompt再进行安装
2018-10-06 17:25:58 7185
原创 groupby
groupby col=col.groupby(['id','money'],as_index=False).sum()按照id 和 money 这两个特征进行转换新表并自动排序 并对其他列进行sum求和 count等id money a b1 1 x y2 1 ...
2018-10-04 13:06:15 1092
原创 OSError: Initializing from file failed
在你写好数据后,进行保存, 可以允许进行中文保存file_name='测试.csv'df.to_csv(file_name)但是在用数据,读取数据的时候f=(file_name)df_csv=pd.read_csv(f)print(df_csv)OSError: Initializing from file failed 会报错! 意思是不让你用中文 如果就...
2018-09-29 15:47:48 328
原创 随笔--防止忘
df=pd.DataFrame(np.random.randn(1000),index=pd.date_range('20170101',periods=1000),columns=['data'])columns=['data'] 列名periods=1000 从20170101到1000个数据df['data'].cumsum()cumsum() 累加cumpr...
2018-09-13 20:56:29 131
原创 The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg.
在使用直方图时,出现警告UserWarning: The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg. warnings.warn("The 'normed' kwarg is deprecated, and has been "意思就是把:normed 换成 density 即...
2018-09-08 08:35:27 6149 3
原创 如何解决 Command "python setup.py egg_info" failed with error code 1 in \AppData\Local\Temp\pip-i
python -m pip install --upgrade --force pippip install mysqlclient==1.3.12即可
2018-07-26 08:41:45 6115 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人