williamleif / graphsage-simple

Simple reference implementation of GraphSAGE.
999 stars 242 forks source link

TypeError: float() argument must be a string or a number, not 'map' #13

Open ZhenhuiTang opened 5 years ago

ZhenhuiTang commented 5 years ago

Traceback (most recent call last): File "/home/machinelearning/anaconda3/envs/graphsage-simple-master/lib/python3.6/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/home/machinelearning/anaconda3/envs/graphsage-simple-master/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/machinelearning/Documents/graphsage-simple-master/graphsage/model.py", line 183, in run_cora() File "/home/machinelearning/Documents/graphsage-simple-master/graphsage/model.py", line 69, in run_cora feat_data, labels, adj_lists = load_cora() File "/home/machinelearning/Documents/graphsage-simple-master/graphsage/model.py", line 49, in load_cora feat_data[i, :] = map(float(), info[1:-1]) TypeError: float() argument must be a string or a number, not 'map'

Andy1314Chen commented 5 years ago

In python3:

feat_data[i, :] = list(map(float(), info[1:-1]))
yeyingdege commented 2 years ago

In python3:

feat_data[i, :] = list(map(float(), info[1:-1]))

Use feat_data[i, :] = list(map(float, info[1:-1]))