例子中ppi数据+faiss检索 部分执行报错
- Dominant language
- C++
- Stars
- 2.9k
- Forks
- 553
- PR merge metrics
- No merged PRs in 30d
Description
使用https://github.com/alibaba/euler/wiki/%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B 中提供的embedding输出与在Faiss中进行检索部分的代码,与文档中的ppi示例数据执行报错,执行流程如下:
```
[lsy@localhost data]$ python -m tf_euler \
> --data_dir ppi \
> --max_id 56944 --feature_idx 1 --feature_dim 50 --label_idx 0 --label_dim 121 \
> --model graphsage_supervised --mode save_embedding
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0227 04:06:31.182329 22828 graph_builder.cc:59] Load Done: ppi/ppi_data.dat
I0227 04:10:39.233194 22828 graph_builder.cc:109] Done: build all sampler
I0227 04:10:39.238440 22828 graph_builder.cc:112] Graph build finish
WARNING:tensorflow:From /usr/lib/python2.7/site-packages/tf_euler/python/layers.py:77: __init__ (from tensorflow.python.ops.init_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.initializers.variance_scaling instead with distribution=uniform to get equivalent behavior.
INFO:tensorflow:Graph was finalized.
2019-02-27 04:10:43.968531: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
INFO:tensorflow:Running local_init_op.
INFO:tensorflow:Done running local_init_op.
2019-02-27 04:10:45.815944: W tensorflow/core/framework/allocator.cc:122] Allocation of 10240000 exceeds 10% of system memory.
2019-02-27 04:10:45.932727: W tensorflow/core/framework/allocator.cc:122] Allocation of 1024000 exceeds 10% of system memory.
2019-02-27 04:10:45.950182: W tensorflow/core/framework/allocator.cc:122] Allocation of 2621440 exceeds 10% of system memory.
2019-02-27 04:10:45.952823: W tensorflow/core/framework/allocator.cc:122] Allocation of 1024000 exceeds 10% of system memory.
2019-02-27 04:10:45.957001: W tensorflow/core/framework/allocator.cc:122] Allocation of 2621440 exceeds 10% of system memory.
[lsy@localhost data]$ cat faiss_test.py
import faiss
import numpy as np
embedding = np.load('ckpt/embedding.npy')
index = faiss.IndexFlatIP(128)
index.add(embedding)
print(index.search(embedding[:5], 4))
[lsy@localhost data]$ python faiss_test.py
Traceback (most recent call last):
File "faiss_test.py", line 6, in
index.add(embedding)
File "/usr/lib/python2.7/site-packages/faiss-0.1-py2.7.egg/faiss/__init__.py", line 102, in replacement_add
assert d == self.d
AssertionError
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the quick-start wiki example and faiss_test.py, then inspect the shape of ckpt/embedding.npy and the dimension passed to faiss.IndexFlatIP. Reproduce the command with the PPI data and compare the embedding shape with the index dimension. Done means the documented embedding and Faiss search run without the assertion error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python, tensorflow
- Domain
- machine-learning, search
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100