tadpole / DHNE

the Implementation of "Structural Deep Embedding for Hyper-Networks"(AAA20I8)
http://nrl.thumedialab.com/Structural-Deep-Embedding-for-Hyper-Networks
44 stars 14 forks source link

TypeError: write() argument must be str, not bytes #1

Closed WangHexie closed 6 years ago

WangHexie commented 6 years ago
Windows 10 Pro 1803 
Python3.6 
numpy==1.14.5

I've created a pull request #2 to fix the problem

WangHexie commented 6 years ago
Traceback (most recent call last):
  File "DHNE/src/hypergraph_embedding.py", line 168, in <module>
    h.save_embeddings(dataset)
  File "DHNE/src/hypergraph_embedding.py", line 126, in save_embeddings
    np.save(open(os.path.join(prefix_path, file_name), 'w'), emds)
  File "C:\Users\w\AppData\Roaming\Python\Python36\site-packages\numpy\lib\npyio.py", line 511, in save
    pickle_kwargs=pickle_kwargs)
  File "C:\Users\w\AppData\Roaming\Python\Python36\site-packages\numpy\lib\format.py", line 565, in write_array
    version)
  File "C:\Users\w\AppData\Roaming\Python\Python36\site-packages\numpy\lib\format.py", line 335, in _write_array_header
    fp.write(header_prefix)
TypeError: write() argument must be str, not bytes
tadpole commented 6 years ago

Yes, I think it is the python version problem. I verify my code in Python 2, I am not sure whether it works in Python 3. Thanks.