我正在群集中使用带有Tensorflow后端的Keras(创建神经网络).如何在群集上(在多个核心上)以多线程方式运行它,还是由Keras自动完成?例如,在Java中,可以创建多个线程,每个线程在核心上运行.
如果可能,应该使用多少个核心?
我按以下方式使用 Huggingface 的句子 BERT:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer('all-MiniLM-L6-v2')
model.max_seq_length = 512
model.encode(text)
Run Code Online (Sandbox Code Playgroud)
当text很长且包含超过 512 个标记时,不会抛出异常。我假设它会自动将输入截断为 512 个标记。
当输入长度大于时如何使其抛出异常max_seq_length?
此外, 的最大可能是max_seq_length多少all-MiniLM-L6-v2?
nlp bert-language-model huggingface-transformers huggingface-tokenizers sentence-transformers
我正在使用 Anaconda,并使用以下命令安装了 PyTorch:pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116
现在我在 torch/utils/cpp_extension.py 中收到以下错误:
UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified
Run Code Online (Sandbox Code Playgroud)
我使用的是 Windows 10,并且已安装 Visual Studio Community 2022 和 Visual Studio Build Tools 2022,请参阅下面的屏幕截图。
有人有什么问题或遗漏吗?
编辑:我正在使用 Cuda 11.6。我现在还安装了 Visual Studio 2019,包括构建工具。现在上面的错误消失了,但我有一个新的错误:
Traceback (most recent call last):
File "C:\Users\myUser\Anaconda3\envs\parlai\lib\site-packages\torch\utils\cpp_extension.py", line 1808, in _run_ninja_build
subprocess.run(
File "C:\Users\myUser\Anaconda3\envs\parlai\lib\subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.
The …Run Code Online (Sandbox Code Playgroud) 我目前正在构建一个基于网络的聊天机器人。作为聊天机器人的一部分,我实现了指示输入的跳点,如下所示:
CSS文件
.jumping-dots span {
position: relative;
margin-left: auto;
margin-right: auto;
animation: jump 1s infinite;
}
.jumping-dots .dot-1{
background-color: #ED49FE;
width:12px;
height:12px;
border-radius:50%;
margin-right:3px;
animation-delay: 200ms;
}
.jumping-dots .dot-2{
background-color: #ED49FE;
width:12px;
height:12px;
border-radius:50%;
margin-right:3px;
animation-delay: 400ms;
}
.jumping-dots .dot-3{
background-color: #ED49FE;
width:12px;
height:12px;
border-radius:50%;
margin-right:3px;
animation-delay: 600ms;
}
@keyframes jump {
0% {bottom: 0px;}
20% {bottom: 5px;}
40% {bottom: 0px;}
}
Run Code Online (Sandbox Code Playgroud)
HTML 文件
<div class="my message">
<span class="jumping-dots">
<span class="dot-1">.</span>
<span class="dot-2">.</span>
<span class="dot-3">.</span>
</span>
</div>
Run Code Online (Sandbox Code Playgroud)
我的问题是,这些点在某种程度上无法正确显示,如下图所示(它们不是圆形的,并且点内有一个黑点):
我的错误在哪里?
其次,我想使用以下代码以编程方式删除点: …
python ×2
css ×1
html ×1
keras ×1
nlp ×1
python-3.x ×1
pytorch ×1
tensorflow ×1
visual-c++ ×1
windows ×1