小编Pey*_*man的帖子

python pip:“错误:遗留安装失败”

我想gensim通过安装 python 包pip install gensim

\n

但是发生了这个错误,我不知道应该做什么来解决它。

\n
      running build_ext\n      building 'gensim.models.word2vec_inner' extension\n      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/\n      [end of output]\n\n  note: This error originates from a subprocess, and is likely not a problem with pip.\nerror: legacy-install-failure\n\n\xc3\x97 Encountered error while trying to install package.\n\xe2\x95\xb0\xe2\x94\x80> gensim\n\nnote: This is an issue with the package mentioned above, not pip.\nhint: See above for output from the failure.\n
Run Code Online (Sandbox Code Playgroud)\n

python pip gensim

30
推荐指数
1
解决办法
15万
查看次数

“没有发现有标签的艺术家可以加入传奇。” 更改 pyplot 中的图例大小时出错

我想在 Pyplot 中使图例尺寸更大。我用这个答案来做到这一点。这是我的代码。

import matplotlib.pyplot as plt
import seaborn as sns

sns.set_style("whitegrid")
plt.rcParams['figure.figsize'] = [15, 7]

lst = [1,2,3,4,5,6,7,8,9,8,7,6,5,4,3,4,5,6]

plt.plot(lst)
plt.legend(fontsize="x-large") # Here I make it bigger but doesn't work
plt.legend(["This is my legend"])
plt.ylabel('some numbers')
plt.show()
Run Code Online (Sandbox Code Playgroud)

我收到此警告,但我不知道出了什么问题。我不明白这里的“艺术家”是什么意思。

没有找到带有标签的艺术家加入传奇。请注意,当不带参数调用 legend() 时,标签以下划线开头的艺术家将被忽略。

python matplotlib legend

14
推荐指数
1
解决办法
4万
查看次数

“学习率预热”是什么意思?

在机器学习中,尤其是深度学习中,热身意味着什么?

我听说有些时候,热身是训练的一个阶段。但说实话,我不知道这是什么,因为我是ML的新手。到目前为止,我从未使用过或接触过它,但是我想知道它,因为我认为它可能对我有用。所以:

什么是学习率热身,何时需要?

提前致谢。

terminology machine-learning neural-network deep-learning

9
推荐指数
2
解决办法
3107
查看次数

如何使用 method = 'loess' 和公式 'y ~ x' 关闭消息“`geom_smooth()`”

当我使用时ggplot,当我使用时,stat_smooth()我会收到如下自动消息:

geom_smooth()使用 method = 'loess' 和公式 'y ~ x

问题是我使用 RMarkdown 构建 PDF,我想在那里显示一些图表。该消息将像这样显示: 在此输入图像描述

我怎样才能关闭此消息?或者任何不将其显示在带有绘图的 PDF 上的方法。

r ggplot2 r-markdown

9
推荐指数
2
解决办法
1万
查看次数

Python 3.5 pip 9 AttributeError:'NoneType'对象没有属性'bytes'

问题是什么?我尝试了" python -m pip install -U pip "和" python -m pip install --upgrade pip "两者都有相同的错误(和" pip install -U --force-reinstall pip ").我该怎么办?

C:\Users\Peyman\PycharmProjects\untitled3>python -m pip install -U pip
Collecting pip
  Using cached https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 9.0.3
    Uninstalling pip-9.0.3:
      Successfully uninstalled pip-9.0.3
  Rolling back uninstall of pip
Exception:
Traceback (most recent call last):
  File "C:\Users\Peyman\AppData\Roaming\Python\Python35\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "C:\Users\Peyman\AppData\Roaming\Python\Python35\site-packages\pip\commands\install.py", line 342, in run
    prefix=options.prefix_path,
  File "C:\Users\Peyman\AppData\Roaming\Python\Python35\site-packages\pip\req\req_set.py", line 784, in install …
Run Code Online (Sandbox Code Playgroud)

python pip python-3.5

6
推荐指数
3
解决办法
3997
查看次数

Colab:libtorch_cuda_cu.so:无法打开共享对象文件:没有这样的文件或目录警告(f“无法加载图像Python扩展:{e}”)

我正在尝试使用aitextgengoogle Colab 中的 python 包,以便我可以微调 GPT。

首先,当我安装这个包的最后一个版本时,在导入它时遇到了这个错误。

Unable to import name '_TPU_AVAILABLE' from 'pytorch_lightning.utilities'
Run Code Online (Sandbox Code Playgroud)

尽管在这个问题中给出的解决方案的帮助下,我可以通过降级我的包来传递这个错误,如下所示:

!pip3 install -q aitextgen==0.5.2
!pip3 install -q torchtext==0.10.0
!pip3 install -q torchmetrics==0.6.0
!pip3 install -q pytorch-lightning==1.4.0rc0
Run Code Online (Sandbox Code Playgroud)

但现在我在导入aitextgen包时遇到这个错误,colab 会崩溃!

/usr/local/lib/python3.8/dist-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: libtorch_cuda_cu.so: cannot open shared object file: No such file or directory
  warn(f"Failed to load image Python extension: {e}")
Run Code Online (Sandbox Code Playgroud)

请记住,错误是在导入包时出现的,并且我的代码中没有错误。更清楚地说,当我像aitextgen这样导入时出现此错误:

import aitextgen
Run Code Online (Sandbox Code Playgroud)

我该如何处理这个错误?

python import google-colaboratory huggingface-transformers gpt-2

6
推荐指数
1
解决办法
5864
查看次数

如何在chrome检查元素中查找图像文件大小

通过使用 Google Chrome 的检查元素,我可以轻松查看图像尺寸。就像在谷歌的网站上解释的那样。

但我也想知道图像文件的大小(大小,如 50kb)。我知道我可以先下载然后在我的电脑上查看图像文件大小,但我认为这不是最好的方法。

我想知道是否可以在 Chrome 的检查元素中找到有关图像文件大小的信息。

google-chrome

5
推荐指数
1
解决办法
2449
查看次数

Pytorch:为什么批处理是默认 LSTM 中的第二个维度?

PyTorch LSTM文档中写道:

\n
\n

batch_first \xe2\x80\x93 如果为 True,则提供输入和输出张量\nas(batch、seq、feature)。默认值:假

\n
\n

我想知道为什么他们选择默认批量维度作为第二个而不是第一个。对我来说,将我的数据成像[batch, seq, feature][seq, batch, feature]. 第一个对我来说更直观,第二个则违反直觉。

\n

我在这里询问这背后是否有任何原因,以及您是否可以帮助我对此有一些了解。

\n

machine-learning deep-learning lstm pytorch

5
推荐指数
1
解决办法
1256
查看次数

PyTorch的clip_grad_norm和clip_grad_norm_,有下划线时有什么区别?

在编写 PyTorch 时,torch.nn.utils我看到两个函数,clip_grad_normclip_grad_norm_

我想知道其中的区别,所以我去检查文档,但是当我搜索时,我只找到了clip_grad_norm_,而没有找到clip_grad_norm.

所以我就来问问大家有没有人知道其中的区别。

gradient backpropagation deep-learning pytorch

5
推荐指数
1
解决办法
1598
查看次数

HuggingFace 的 TextGeneration 和 Text2TextGeneration 管道有什么区别

我对两个 Huggingface 管道TextGenerationText2TextGeneration之间的技术差异感到困惑。

在 TextGeneration 中指出:

使用任何 ModelWithLMHead 的语言生成管道。该管道预测指定文本提示后面的单词。

但不是有语言模型可以做到这一点吗?“预测下一个单词”?那么这个管道与 Text2TextGeneration 有什么不同呢?Text2TextGeneration 不会预测下一个可能的单词吗?

我还尝试了使用“Text2TextGeneration”管道的一些模型,尽管 HuggingFace 发出警告“该模型不支持 text2text- Generation”,但它实际上有效并生成了一些输出。

如果有人可以解释技术差异,我们将不胜感激。

nlp huggingface-transformers huggingface

5
推荐指数
1
解决办法
1478
查看次数