We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
运行如下代码时总是报错 node_types_file = "./rec_data/node_types.txt" edges_file = "./rec_data/user2movie.txt" embed_path = "./env_run/src/save_embed/embedding.txt" movie_name_file = "./rec_data/nid2movieName.txt"
nid2type = load_vocab(node_types_file) movie2vec, vec_dim = load_embed(embed_path, nid2type, dtype="movie") user2vec, _ = load_embed(embed_path, nid2type, dtype="user")
print("building ann tree") annIndex = AnnTree(user2vec, vec_dim)
print("loading user2likedMovies") user2likedMovies = load_user2movies(edges_file)
print("loading movie2name") movie2name = load_movie2name(movie_name_file)
UnboundLocalError Traceback (most recent call last) /tmp/ipykernel_199/1169641705.py in 8 nid2type = load_vocab(node_types_file) 9 movie2vec, vec_dim = load_embed(embed_path, nid2type, dtype="movie") ---> 10 user2vec, _ = load_embed(embed_path, nid2type, dtype="user") 11 12 print("building ann tree")
~/Graph4Rec/evaluation/evaluation.py in load_embed(embed_file, metaID2type, dtype) 48 embed = [float(i) for i in fields[1].split(" ")] 49 nodeID2vec[node_id] = embed ---> 50 vec_dim = len(embed) 51 52 return nodeID2vec, vec_dim
UnboundLocalError: local variable 'embed' referenced before assignment
不清楚为何内置函数的变量会被分配。感谢解答
The text was updated successfully, but these errors were encountered:
你的embedding 文件是空的吧。
Sorry, something went wrong.
可能是因为你没有启动图引擎就开始训练,这样就没有节点被训练到,embedding文件就是空的。
No branches or pull requests
运行如下代码时总是报错
node_types_file = "./rec_data/node_types.txt"
edges_file = "./rec_data/user2movie.txt"
embed_path = "./env_run/src/save_embed/embedding.txt"
movie_name_file = "./rec_data/nid2movieName.txt"
nid2type = load_vocab(node_types_file)
movie2vec, vec_dim = load_embed(embed_path, nid2type, dtype="movie")
user2vec, _ = load_embed(embed_path, nid2type, dtype="user")
print("building ann tree")
annIndex = AnnTree(user2vec, vec_dim)
print("loading user2likedMovies")
user2likedMovies = load_user2movies(edges_file)
print("loading movie2name")
movie2name = load_movie2name(movie_name_file)
报错如下
UnboundLocalError Traceback (most recent call last)
/tmp/ipykernel_199/1169641705.py in
8 nid2type = load_vocab(node_types_file)
9 movie2vec, vec_dim = load_embed(embed_path, nid2type, dtype="movie")
---> 10 user2vec, _ = load_embed(embed_path, nid2type, dtype="user")
11
12 print("building ann tree")
~/Graph4Rec/evaluation/evaluation.py in load_embed(embed_file, metaID2type, dtype)
48 embed = [float(i) for i in fields[1].split(" ")]
49 nodeID2vec[node_id] = embed
---> 50 vec_dim = len(embed)
51
52 return nodeID2vec, vec_dim
UnboundLocalError: local variable 'embed' referenced before assignment
不清楚为何内置函数的变量会被分配。感谢解答
The text was updated successfully, but these errors were encountered: