Comments (4)
不好意思,我的问题,pad_mask不需要你手动设置,这是我昨天更新版本时留的一个bug。等会我重新检查一遍脚本后,会更新代码,预计下午5点以前,到时候你pull一下新代码就行 @17freeman
from knn-box.
@17freeman 嗨,代码已经更新了。我看你贴的命令里,在生成vanilla_knn_mt的datastore时使用了adaptive_knn_mt@transformer_wmt19_de_en这个arch, 虽然这样也可以(adaptive kNN-MT和vanilla kNN-MT生成的datastore一样),但生成vanilla datastore时比较推荐用vanilla_knn_mt@transformer_wmt19_de_en这个arch,理解起来比较统一
from knn-box.
学长,在build_faiss_index这一步,faiss.index_cpu_to_gpu(),出现了faiss::gpu::StandardGpuResourcesImpl::allocMemory(const struct faiss::gpu::AllocRequest &) at D:\bld\faiss-split_1667330512241\work\faiss\gpu\StandardGpuResources.cpp:452: Error: 'err == cudaSuccess' failed: StandardGpuResources: alloc fail type TemporaryMemoryBuffer dev 0 space Device stream 0000014F0A2B0240 size 1073741824 bytes (cudaMalloc error out of memory [2])
我是在我本地的笔记本上跑的,我想问,可不可以通过调节参数,把size设置小一点。
from knn-box.
可以试试把num_keys_to_add_at_a_time改小点,打开knnbox/datastore/datastore.py, 文件末尾的build_faiss_index函数调用时加行参数:
def build_faiss_index(self, name, verbose=True, use_pca=False, pca_dim=256):
r"""
build faiss index for a data.
the output file named name+.faiss_index
Args:
name: The data name which need to build faiss index
verbose: display detailed message
use_pca: wether do a PCA when building faiss index
pca_dim: if use PCA, the PCA output dim
"""
if not isinstance(self.datas[name], Memmap):
print("ERROR: can only build faiss for Memmap object.")
os.exit(1)
# build faiss
build_faiss_index(
self.datas[name].data,
self.datas[name].shape,
os.path.join(self.path, name+".faiss_index"),
use_pca=use_pca,
pca_dim=pca_dim,
verbose=verbose,
num_keys_to_add_at_a_time=100000, # 加这行,这个值默认是50w,改小点试试
)
如果还是溢出就没办法了,一般10G显存的卡是够用的
from knn-box.
Related Issues (20)
- 关于plac-knn-mt运行报错 HOT 1
- KeyError: 'keys' HOT 4
- 基础NMT模型fairseq版本冲突问题 HOT 18
- 推理训练数据与标签不一致 HOT 4
- 感谢您指出这个问题。我们经过对checkpoint文件的对比,确认了您提出的现象,您可以按照下面的示例代码,对checkpoint进行一个小的修改,以正常加载,而kNN-BOX的代码无需修改:
- 关于vanilla-knn-mt inference报错 HOT 1
- Question about multilingual experiments in kNN-BOX paper HOT 3
- 翻译错误:AssertionError: interactive mode, should have only one sentence HOT 1
- the blue-score always 0 HOT 5
- 关于运行速度的问题 HOT 3
- 关于计时的一个问题 HOT 3
- 关于RuntimeError: Error(s) in loading state_dict for VanillaKNNMT: HOT 1
- 您好,当我运行adaptive-knn-mt中的build_datasotre.sh时,报No moudle named'knnbox' HOT 12
- Multi-processing for huge datastore HOT 2
- FileNotFoundError: /home/demo/knn-box/knnbox/models HOT 1
- 是否可以在fairseq0.12.0版本进行使用?
- 运行vanilla-knn-mt-visual出错 HOT 9
- 运行adaptive knn-mt出错 HOT 2
- KeyError when load_faiss_index from a dumpped datastore
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knn-box.