Giter Club home page Giter Club logo

strnn's People

Contributors

yongqyu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

strnn's Issues

RuntimeError: cuda runtime error (59) : device-side assert triggered at /pytorch/aten/src/THC/generated/../THCReduceAll.cuh:339

Thank you for releasing the code, after running preprocess.py, I ran train_torch.py, but at 78% of first epoch, I got this error, any suggestion on solving this error? Many thanks.
Environment information:
OS: 16.04.5
python 3.5.2
pytorch 0.4.0
GPU: nvidia gtx1070

smiles@smiles:~/keli/STRNN$ python3 train_torch.py 
Loading data...
User/Location: 32899/1115406/42133
==================================================================================
train:  78%|███████████████████████████████████████████████████████████████████████████████████████████████████████████▍                              | 32815/42133 [1:29:11<13:29, 11.51it/s]/pytorch/aten/src/THC/THCTensorIndex.cu:306: void indexSelectSmallIndex(TensorInfo<T, IndexType>, TensorInfo<T, IndexType>, TensorInfo<long, IndexType>, int, int, IndexType, long) [with T = float, IndexType = unsigned int, DstDim = 2, SrcDim = 2, IdxDim = -2]: block: [0,0,0], thread: [0,0,0] Assertion `srcIndex < srcSelectDimSize` failed.
/pytorch/aten/src/THC/THCTensorIndex.cu:306: void indexSelectSmallIndex(TensorInfo<T, IndexType>, TensorInfo<T, IndexType>, TensorInfo<long, IndexType>, int, int, IndexType, long) [with T = float, IndexType = unsigned int, DstDim = 2, SrcDim = 2, IdxDim = -2]: block: [0,0,0], thread: [1,0,0] Assertion `srcIndex < srcSelectDimSize` failed.
/pytorch/aten/src/THC/THCTensorIndex.cu:306: void indexSelectSmallIndex(TensorInfo<T, IndexType>, TensorInfo<T, IndexType>, TensorInfo<long, IndexType>, int, int, IndexType, long) [with T = float, IndexType = unsigned int, DstDim = 2, SrcDim = 2, IdxDim = -2]: block: [0,0,0], thread: [2,0,0] Assertion `srcIndex < srcSelectDimSize` failed.
/pytorch/aten/src/THC/THCTensorIndex.cu:306: void indexSelectSmallIndex(TensorInfo<T, IndexType>, TensorInfo<T, IndexType>, TensorInfo<long, IndexType>, int, int, IndexType, long) [with T = float, IndexType = unsigned int, DstDim = 2, SrcDim = 2, IdxDim = -2]: block: [0,0,0], thread: [3,0,0] Assertion `srcIndex < srcSelectDimSize` failed.
/pytorch/aten/src/THC/THCTensorIndex.cu:306: void indexSelectSmallIndex(TensorInfo<T, IndexType>, TensorInfo<T, IndexType>, TensorInfo<long, IndexType>, int, int, IndexType, long) [with T = float, IndexType = unsigned int, DstDim = 2, SrcDim = 2, IdxDim = -2]: block: [0,0,0], thread: [4,0,0] Assertion `srcIndex < srcSelectDimSize` failed.
/pytorch/aten/src/THC/THCTensorIndex.cu:306: void indexSelectSmallIndex(TensorInfo<T, IndexType>, TensorInfo<T, IndexType>, TensorInfo<long, IndexType>, int, int, IndexType, long) [with T = float, IndexType = unsigned int, DstDim = 2, SrcDim = 2, IdxDim = -2]: block: [0,0,0], thread: [5,0,0] Assertion `srcIndex < srcSelectDimSize` failed.
/pytorch/aten/src/THC/THCTensorIndex.cu:306: void indexSelectSmallIndex(TensorInfo<T, IndexType>, TensorInfo<T, IndexType>, TensorInfo<long, IndexType>, int, int, IndexType, long) [with T = float, IndexType = unsigned int, DstDim = 2, SrcDim = 2, IdxDim = -2]: block: [0,0,0], thread: [6,0,0] Assertion `srcIndex < srcSelectDimSize` failed.
/pytorch/aten/src/THC/THCTensorIndex.cu:306: void indexSelectSmallIndex(TensorInfo<T, IndexType>, TensorInfo<T, IndexType>, TensorInfo<long, IndexType>, int, int, IndexType, long) [with T = float, IndexType = unsigned int, DstDim = 2, SrcDim = 2, IdxDim = -2]: block: [0,0,0], thread: [7,0,0] Assertion `srcIndex < srcSelectDimSize` failed.
/pytorch/aten/src/THC/THCTensorIndex.cu:306: void indexSelectSmallIndex(TensorInfo<T, IndexType>, TensorInfo<T, IndexType>, TensorInfo<long, IndexType>, int, int, IndexType, long) [with T = float, IndexType = unsigned int, DstDim = 2, SrcDim = 2, IdxDim = -2]: block: [0,0,0], thread: [8,0,0] Assertion `srcIndex < srcSelectDimSize` failed.
/pytorch/aten/src/THC/THCTensorIndex.cu:306: void indexSelectSmallIndex(TensorInfo<T, IndexType>, TensorInfo<T, IndexType>, TensorInfo<long, IndexType>, int, int, IndexType, long) [with T = float, IndexType = unsigned int, DstDim = 2, SrcDim = 2, IdxDim = -2]: block: [0,0,0], thread: [9,0,0] Assertion `srcIndex < srcSelectDimSize` failed.
/pytorch/aten/src/THC/THCTensorIndex.cu:306: void indexSelectSmallIndex(TensorInfo<T, IndexType>, TensorInfo<T, IndexType>, TensorInfo<long, IndexType>, int, int, IndexType, long) [with T = float, IndexType = unsigned int, DstDim = 2, SrcDim = 2, IdxDim = -2]: block: [0,0,0], thread: [10,0,0] Assertion `srcIndex < srcSelectDimSize` failed.
/pytorch/aten/src/THC/THCTensorIndex.cu:306: void indexSelectSmallIndex(TensorInfo<T, IndexType>, TensorInfo<T, IndexType>, TensorInfo<long, IndexType>, int, int, IndexType, long) [with T = float, IndexType = unsigned int, DstDim = 2, SrcDim = 2, IdxDim = -2]: block: [0,0,0], thread: [11,0,0] Assertion `srcIndex < srcSelectDimSize` failed.
/pytorch/aten/src/THC/THCTensorIndex.cu:306: void indexSelectSmallIndex(TensorInfo<T, IndexType>, TensorInfo<T, IndexType>, TensorInfo<long, IndexType>, int, int, IndexType, long) [with T = float, IndexType = unsigned int, DstDim = 2, SrcDim = 2, IdxDim = -2]: block: [0,0,0], thread: [12,0,0] Assertion `srcIndex < srcSelectDimSize` failed.
THCudaCheck FAIL file=/pytorch/aten/src/THC/generated/../THCReduceAll.cuh line=339 error=59 : device-side assert triggered
Traceback (most recent call last):
  File "train_torch.py", line 202, in <module>
    total_loss += run(batch_user, batch_td, batch_ld, batch_loc, batch_dst, step=1)
  File "train_torch.py", line 181, in run
    J = strnn_model.loss(user, td_upper, td_lower, ld_upper, ld_lower, location, destination, rnn_output)#, neg_lati, neg_longi, neg_loc, step)
  File "train_torch.py", line 101, in loss
    l2_reg.append(W.norm(2))
RuntimeError: cuda runtime error (59) : device-side assert triggered at /pytorch/aten/src/THC/generated/../THCReduceAll.cuh:339
Exception ignored in: <bound method tqdm.__del__ of train:  78%|███████████████████████████████████████████████████████████████████████████████████████████████████████████▍                              | 32815/42133 [1:29:11<13:29, 11.51it/s]>
Traceback (most recent call last):
  File "/home/smiles/.local/lib/python3.5/site-packages/tqdm/_tqdm.py", line 889, in __del__
    self.close()
  File "/home/smiles/.local/lib/python3.5/site-packages/tqdm/_tqdm.py", line 1095, in close
    self._decr_instances(self)
  File "/home/smiles/.local/lib/python3.5/site-packages/tqdm/_tqdm.py", line 454, in _decr_instances
    cls.monitor.exit()
  File "/home/smiles/.local/lib/python3.5/site-packages/tqdm/_monitor.py", line 52, in exit
    self.join()
  File "/usr/lib/python3.5/threading.py", line 1051, in join
    raise RuntimeError("cannot join current thread")
RuntimeError: cannot join current thread

Question about the Gowalla dataset

Hi Yongqyu,

Thank you for re-implementing ST-RNN. I am quite interested in it. However, I have some questions about the Gowalla dataset in the file prepro_train_50.txt. The code says that time_window=360 minutes, but in the first column of the file prepro_train_50.txt have some time interval greater than 360 minutes:
1
82.25 0.331054 133 132
1297.62 0.109035 132 131
382.5,321.375,32.5625 0.0926226,0.0924566,0.00229809 131,130,129 128
3783.62 9.29145 128 6
1942.94 0.00119504 6 1
3338.06 25.7679 1 127
2272.69 25.7676 127 35

By the way, what is your opinion about this ?

Thanks,
Liu zhuang

Question about the performance

Hi Yongqyu,

Thank you for re-implementing ST-RNN. I am quite interested in it. However, I find that the recall performances are largely lower than the figures given in the paper.

My results (15 epochs):
('recall@1: ', 0.0010507880910683013)
('recall@5: ', 0.0051138353765324)
('recall@10: ', 0.00903677758318739)
('recall@100: ', 0.025218914185639228)
('recall@1000: ', 0.0533800350262697)
('recall@10000: ', 0.09936952714535902)

Results in the paper:
recall@1 0.0304,
recall@5 0.1524
recall@10 0.2714

It seems that the model is overfitting. And I noticed that your regulation parameter is set to be 0.0005, but the author set this parameter to be 0.01. I'll try 0.01 shortly.

By the way, what is your opinion about this performance difference?

Thanks,
Charles

The recall of result

Hi, yongqyu
Sorry to bother you. Recently i want to compare my work with strnn. If i want to use prediction precision to evaluate this model in your code. How can i modify? Can you give me some advice?
Very thanks

dataset

Sorry to bother you.
When I tried to use the processed dataset to train,it runned very well,but when I was trying to use the 'preprocess.py' to cut the dataset 'Gowalla_totalCheckins.txt', an error has occurred, “too many indices for array“ ,line 100,finally i have fixed it ,in line 100 and 102 you need to delete '[0]' .

data = ','.join(str(e.data.cpu().numpy()) for e in locs[w_cap:idx])+"\t"
f.write(data)
data = str(locs[idx].data.cpu().numpy())+"\n"
f.write(data)

about the caculate of ht

论文里面对ht的计算是使用了下一个POI与lastPOI的时空间间隔,但是在validation那里使用的时空间间隔貌似只用到了dst与lastPOI的时空间间隔,并没有计算所有POI与lastPOI的时空间间隔,是我理解错误了吗

Loss function differs from that in the paper

In train_torch.py line 98-104, the loss function is implemented as

    def loss(self, user, td_upper, td_lower, ld_upper, ld_lower, loc, dst, hx):
        h_tq = self.forward(td_upper, td_lower, ld_upper, ld_lower, loc, hx)
        p_u = self.permanet_weight(user)
        q_v = self.location_weight(dst)
        output = torch.mm(q_v, (h_tq + torch.t(p_u)))

        return torch.log(1+torch.exp(torch.neg(output)))

However, in the paper, the loss function is as following
image
I thought output in the codes refers to Ou,v,t but where is Ou,v,t' in codes? Meanwhile, it seems the regulation part is not considered as well.

IndexError: too many indices for array--About "0. Preprocessing"

Could you help me? Thank you very much!!!!

After having Gowallat ../dataset/.
then
$ python preprocess.py
I got error like this:IndexError: too many indices for array

python ./preprocess.py
Loading data...
User/Location: 42242/1164559

Making train file...
train: 0%| | 0/42241 [00:00<?, ?it/s]
Traceback (most recent call last):
File "./preprocess.py", line 148, in
run(train_user[j], batch_time, batch_lati, batch_longi, batch_loc, step=1)
File "./preprocess.py", line 137, in run
rnn_output = strnn_model(user, time, lati, longi, loc, step)#, neg_lati, neg_longi, neg_loc, step)
File "/home/swim/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "./preprocess.py", line 126, in forward
pos_h = self.return_h_tw(times, latis, longis, locs, len(times)-1)
File "./preprocess.py", line 89, in return_h_tw
self.return_h_tw(times, latis, longis, locs, w_cap)
File "./preprocess.py", line 89, in return_h_tw
self.return_h_tw(times, latis, longis, locs, w_cap)
File "./preprocess.py", line 89, in return_h_tw
self.return_h_tw(times, latis, longis, locs, w_cap)
[Previous line repeated 136 more times]
File "./preprocess.py", line 100, in return_h_tw
data = ','.join(str(e.data.cpu().numpy()[0]) for e in locs[w_cap:idx])+"\t"
File "./preprocess.py", line 100, in
data = ','.join(str(e.data.cpu().numpy()[0]) for e in locs[w_cap:idx])+"\t"
IndexError: too many indices for array

about the preprocessing

Thank you for the implemention of ST-RNN.I have get some questions about the code.

  1. How do you choose value for the time unper bound of low bound ? And the dst unper bound and low bound.

  2. given a user's trajectory ,how could you handle the trajectory and make each check_in ( user, lat,lng, time-stamp) into user-td,user-ld,user-loc,user-dst.
    image

  3. I want to know how the loc_len is calculated.For example,if the window width is 6h,and three check-in is within 6 h,such as A ,B,C, then A 's loc_len is 1, B's loc_len is 2, C's loc_len is 3?

I would appreciate it a lot if you could help me.Best wishes to you.Cause I have to know the answers to preprocess my

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.