vonfeng / DeepMove

Codes for WWW'18 Paper-DeepMove: Predicting Human Mobility with Attentional Recurrent Network
GNU General Public License v2.0
143 stars 56 forks source link

Compatibility with Python 3.7 with no GPU #1

Closed vaibhav90 closed 5 years ago

vaibhav90 commented 5 years ago

Hello, Thank you for this very interesting work! If anyone wants to run this on Python 3.7 with no cuda enabled, you need to do the following changes.

  1. import cPickle as pickle -> import pickle

  2. Avoid error while reading ASCII with pickle

data = pickle.load(open(self.data_path + self.data_name + '.pk', 'rb')) - >

with open(self.data_path + self.data_name + '.pk', 'rb') as f:
            u = pickle._Unpickler(f)
            u.encoding = 'latin1'
            data = u.load()
  1. There is a race condition occuraing while creating directories

os.mkdir(SAVE_PATH + tmp_path) - > os.makedirs(SAVE_PATH + tmp_path, exist_ok=True)

vonfeng commented 5 years ago

Thank you for your valuable supplement~