<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[江南蜡笔小新]]></title><description><![CDATA[Welcome to the new world.]]></description><link>https://blog.csdn.net/ftimes</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; ftimes]]></copyright><item><title><![CDATA[-tf.reduce_sum(one_hot_labels * log_probs, axis=-1)是什么损失函数？]]></title><link>https://blog.csdn.net/ftimes/article/details/126875105</link><guid>https://blog.csdn.net/ftimes/article/details/126875105</guid><author>ftimes</author><pubDate>Thu, 15 Sep 2022 17:01:57 +0800</pubDate><description><![CDATA[-tf.reduce_sum(one_hot_labels * log_probs, axis=-1)是什么损失函数？由于BERT代码当初是用Tensorflow1.x发布的，阅读代码时没太看懂这个loss function]]></description><category></category></item><item><title><![CDATA[tf1.x和tf2.x查看TFRecord数据的方法]]></title><link>https://blog.csdn.net/ftimes/article/details/126711748</link><guid>https://blog.csdn.net/ftimes/article/details/126711748</guid><author>ftimes</author><pubDate>Mon, 05 Sep 2022 19:26:58 +0800</pubDate><description><![CDATA[【代码】tf1.x和tf2.x查看TFRecord数据的方法。]]></description><category></category></item><item><title><![CDATA[tensor(): argument ‘dtype‘ must be torch.dtype, not torch.tensortype]]></title><link>https://blog.csdn.net/ftimes/article/details/125048788</link><guid>https://blog.csdn.net/ftimes/article/details/125048788</guid><author>ftimes</author><pubDate>Mon, 30 May 2022 16:24:03 +0800</pubDate><description><![CDATA[torch.dtype和torch.tensortype的区别。
最近调试代码，报错TypeError: tensor(): argument ‘dtype’ must be torch.dtype, not torch.tensortype，原因则是因为在dtype参数中错误的传递了torch.tensortype。
PyTorch有十二种不同的数据类型，简单来说，torch.dtype是现行描述数据类型的形式，存在着Legacy Constructors，他们之间的对应关系如下：


Data type]]></description><category></category></item><item><title><![CDATA[三行代码：使用一个数组(list)对另一个数组(list)进行排序]]></title><link>https://blog.csdn.net/ftimes/article/details/124865513</link><guid>https://blog.csdn.net/ftimes/article/details/124865513</guid><author>ftimes</author><pubDate>Thu, 19 May 2022 16:11:51 +0800</pubDate><description><![CDATA[Python自带的库中没有直接提供使用一个数组对另一个数组进行排序的方案，但有很直接的解决方案：
example:
arr1=[5,3,1,4,2]
arr2=['e','c','a','d','b']
sorted(zip(arr1,arr2))

排序后：
[(1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e')]

这个例子中就是使用arr1对arr2进行排序，简单来说就是利用了zip打包在一起，然后arr1中的元素作为key进行排序。

...]]></description><category></category></item><item><title><![CDATA[从第一行代码学Python：理解from..import]]></title><link>https://blog.csdn.net/ftimes/article/details/124613285</link><guid>https://blog.csdn.net/ftimes/article/details/124613285</guid><author>ftimes</author><pubDate>Fri, 06 May 2022 17:45:59 +0800</pubDate><description><![CDATA[from ..module import xxx是什么意思？Python中from 省略号/点点 Import ..是什么意思？]]></description><category></category></item><item><title><![CDATA[相对位置编码两篇简要笔记]]></title><link>https://blog.csdn.net/ftimes/article/details/124409566</link><guid>https://blog.csdn.net/ftimes/article/details/124409566</guid><author>ftimes</author><pubDate>Mon, 25 Apr 2022 19:42:46 +0800</pubDate><description><![CDATA[Shaw P, Uszkoreit J, Vaswani A. Self-attention with relative position representations[J]. arXiv preprint arXiv:1803.02155, 2018.



结合相对位置和绝对位置表征，翻译质量没有进一步提高。
英德互译实验结果

In our experiments we did not observe any benefit from including sinusoidal position ..]]></description><category></category></item><item><title><![CDATA[[笔记]BERT数据预处理超长句子的逻辑]]></title><link>https://blog.csdn.net/ftimes/article/details/124067191</link><guid>https://blog.csdn.net/ftimes/article/details/124067191</guid><author>ftimes</author><pubDate>Sat, 09 Apr 2022 20:25:01 +0800</pubDate><description><![CDATA[if i == len(document) - 1 or current_length &gt;= target_seq_length:
      if current_chunk:
        # `a_end` is how many segments from `current_chunk` go into the `A`
        # (first) sentence.
        a_end = 1
        if len(current_chunk) &gt;= 2...]]></description><category></category></item><item><title><![CDATA[[Bug]TypeError: save_pretrained() missing 1 required positional argument: ‘save_directory‘]]></title><link>https://blog.csdn.net/ftimes/article/details/124065726</link><guid>https://blog.csdn.net/ftimes/article/details/124065726</guid><author>ftimes</author><pubDate>Sat, 09 Apr 2022 18:48:23 +0800</pubDate><description><![CDATA[记录一个Bug，
Bug产生的原因:
继承了huggingface的tokenizer类。
解决方法：
构建复写新的完整的父类

]]></description><category></category></item><item><title><![CDATA[查看tfrecord数据内容]]></title><link>https://blog.csdn.net/ftimes/article/details/123946834</link><guid>https://blog.csdn.net/ftimes/article/details/123946834</guid><author>ftimes</author><pubDate>Sun, 03 Apr 2022 23:09:29 +0800</pubDate><description><![CDATA[import sys
import tensorflow as tf
import config
def main():
filepath = config.data_path_tf
with tf.Session() as sess:
filenames = [filepath]
# 加载TFRecord数据
ds = tf.data.TFRecordDataset(filenames)
# 读取N条
ds = ds.batch(2)
ds = ds.prefetch(buffer_size=tf.con]]></description><category></category></item><item><title><![CDATA[python怎么从文件/字符串读取日期]]></title><link>https://blog.csdn.net/ftimes/article/details/122462761</link><guid>https://blog.csdn.net/ftimes/article/details/122462761</guid><author>ftimes</author><pubDate>Wed, 12 Jan 2022 21:23:40 +0800</pubDate><description><![CDATA[分享一个相见恨晚的库dateutil，之前只知道Java有，没想到Python也有，只是需要额外安装：
pip install python-dateutil

安装完成后，解析的字符串很随意，
搬运官方的一个example
&gt;&gt;&gt; from dateutil.parser import *
&gt;&gt;&gt; from dateutil.tz import *
&gt;&gt;&gt; from datetime import *
&gt;&gt;&gt; TZOFFSETS = ]]></description><category></category></item><item><title><![CDATA[[解决方案] ModuleNotFoundError: No module named ‘propeller‘]]></title><link>https://blog.csdn.net/ftimes/article/details/121931010</link><guid>https://blog.csdn.net/ftimes/article/details/121931010</guid><author>ftimes</author><pubDate>Mon, 20 Dec 2021 19:22:32 +0800</pubDate><description><![CDATA[在使用Paddle某个预训练模型中，报错ModuleNotFoundError: No module named ‘propeller’
官方推荐使用
export PYTHONPATH=./:$PYTHONPATH

由于并不是一个独立的环境，所以不想添加环境变量。
采取另外一种临时解决方案为：
将上述代码粘贴到import propeller之前即可

...]]></description><category></category></item><item><title><![CDATA[[解决方案] from propeller.paddle.data import feature_pb2, example_pb2报错]]></title><link>https://blog.csdn.net/ftimes/article/details/121931233</link><guid>https://blog.csdn.net/ftimes/article/details/121931233</guid><author>ftimes</author><pubDate>Mon, 20 Dec 2021 19:21:27 +0800</pubDate><description><![CDATA[在使用飞桨Paddle某个预训练模型时， from propeller.paddle.data import feature_pb2, example_pb2报错ImportError: cannot import name ‘feature_pb2’ from ‘propeller.paddle.data’
查阅了很多资料，均没有相关信息，追溯到手册发现，可能是版本迭代更新的问题。
解决方案如下：]]></description><category></category></item><item><title><![CDATA[不手动配置json文件，vscode选择python环境/解释器]]></title><link>https://blog.csdn.net/ftimes/article/details/122027212</link><guid>https://blog.csdn.net/ftimes/article/details/122027212</guid><author>ftimes</author><pubDate>Sun, 19 Dec 2021 18:04:43 +0800</pubDate><description><![CDATA[vscode作为免费的编辑器，支持各种语言，只是配置稍显麻烦，网上花里胡哨的json文件不但折磨人，复制粘贴了还不一定能用。
这种现象现在已经改观许多了，通过下面这行命令，可以不用手动配置json文件，直接选择。
第一步，Ctrl+p，顶端会出现一个命令输入窗口。
第二步，复制下面这行代码。（注意，要包括前面那个尖尖）
此时就会弹出环境选择的界面：


...]]></description><category></category></item><item><title><![CDATA[DDP/DistributedDataParallel 报错RuntimeError: Address already in use]]></title><link>https://blog.csdn.net/ftimes/article/details/121973542</link><guid>https://blog.csdn.net/ftimes/article/details/121973542</guid><author>ftimes</author><pubDate>Thu, 16 Dec 2021 14:23:01 +0800</pubDate><description><![CDATA[在测试pytorch多卡的时候报错：
store = TCPStore(master_addr, master_port, world_size, start_daemon, timeout)
RuntimeError: Address already in use
经查，是还有另外一个任务也在用DDP跑，解决方案：

...]]></description><category></category></item><item><title><![CDATA[[解决方案]ModuleNotFoundError: No module named ‘datasets‘]]></title><link>https://blog.csdn.net/ftimes/article/details/121940589</link><guid>https://blog.csdn.net/ftimes/article/details/121940589</guid><author>ftimes</author><pubDate>Tue, 14 Dec 2021 21:34:12 +0800</pubDate><description><![CDATA[报错ModuleNotFoundError: No module named ‘datasets’
解决方案如下:



]]></description><category></category></item><item><title><![CDATA[怎么同时安装pytorch与tensorflow对应兼容的版本]]></title><link>https://blog.csdn.net/ftimes/article/details/121866555</link><guid>https://blog.csdn.net/ftimes/article/details/121866555</guid><author>ftimes</author><pubDate>Fri, 10 Dec 2021 23:03:25 +0800</pubDate><description><![CDATA[最近做到一个项目,需要混合使pytorch与tensorflow.
并且tensorflow要求1.15.
查阅cuda与cudnn版本对应之后, 由于平时使用的pytorch,pytorch也可以指定cuda套件版本,于是乎先装了pytorch1.7,然后尝试用cuda安装tensorflow1.15,
却死活都装不上,换成pip装上之后检测不到GPU.
cuda与cudnn均是按官网要求来的.

conda排查兼容性问题, 结果奇怪,所有的依赖都在其显示的要求之内.
后来全部卸载,先裝了tensorfl]]></description><category></category></item><item><title><![CDATA[[实时更新]tensorflow与cuda cudnn版本兼容性]]></title><link>https://blog.csdn.net/ftimes/article/details/121865646</link><guid>https://blog.csdn.net/ftimes/article/details/121865646</guid><author>ftimes</author><pubDate>Fri, 10 Dec 2021 21:53:13 +0800</pubDate><description><![CDATA[官方实时更新地址:[tensorflow与cuda cudnn版本兼容性]tensorflow与cuda cudnn版本兼容性](https://tensorflow.google.cn/install/source#gpu)
避免某些朋友浏览不太方便,这里给出最新的结果:
Linux:
Windows:


]]></description><category></category></item><item><title><![CDATA[[小技巧] 如何让vscode目录不折叠?]]></title><link>https://blog.csdn.net/ftimes/article/details/121568591</link><guid>https://blog.csdn.net/ftimes/article/details/121568591</guid><author>ftimes</author><pubDate>Fri, 26 Nov 2021 21:03:26 +0800</pubDate><description><![CDATA[在使用VsCode中, 发现如果是单层文件夹的话,vscode会把目录折叠起来.
虽说对于Java的包结构也许会清晰很多,但对于Python用户真的并不是那么方便.

解决方案:
ctrl+, 打开设置
搜索
把这个钩取消掉
即可恢复为一个正常的VSCode


...]]></description><category></category></item><item><title><![CDATA[[解决方案] 如何让Ubuntu 切换程序不合并标签]]></title><link>https://blog.csdn.net/ftimes/article/details/121544013</link><guid>https://blog.csdn.net/ftimes/article/details/121544013</guid><author>ftimes</author><pubDate>Thu, 25 Nov 2021 18:12:15 +0800</pubDate><description><![CDATA[Ubuntu使用Alt+Tab的时候发现会把同一个应用程序的窗口合并在一起,要点击箭头才能选具体的窗口.
对这个功能, 我表示很不理解.
解决方案:
设置-&gt;设备-&gt;键盘
我们可以看到默认的切换窗口是禁用的, Alt+Tab指向的是切换应用程序.
我们直接把切换窗口改成Alt+Tab, 切换应用程序的快捷键会自动禁用.
此时即可流畅切换.


...]]></description><category></category></item><item><title><![CDATA[[aminer] 2020清华大学人工智能发展报告pdf]]></title><link>https://blog.csdn.net/ftimes/article/details/121512412</link><guid>https://blog.csdn.net/ftimes/article/details/121512412</guid><author>ftimes</author><pubDate>Wed, 24 Nov 2021 12:01:16 +0800</pubDate><description><![CDATA[「2020清华人工智能发展报告.pdf」，点击链接保存，或者复制本段内容，打开「阿里云盘」APP ，无需下载，极速在线查看享用。]]></description><category></category></item></channel></rss>