You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-1-423abe3e7cdf> in <module>()
270 train_reorder_dream()
271 else:
--> 272 train_dream()
273 print('-' * 89)
274 if constants.REORDER:
<ipython-input-1-423abe3e7cdf> in train_dream()
82 for i, x in enumerate(batchify(train_ub, dr_config.batch_size)):
83 baskets, lens, _ = x
---> 84 dr_hidden = repackage_hidden(dr_hidden) # repackage hidden state for RNN
85 dr_model.zero_grad() # optim.zero_grad()
86 dynamic_user, _ = dr_model(baskets, lens, dr_hidden)
~/SageMaker/MBA/Instacart/src/utils.py in repackage_hidden(h)
92 return Variable(h.data)
93 else:
---> 94 return tuple(repackage_hidden(v) for v in h)
95
96 ###################### Summary
~/SageMaker/MBA/Instacart/src/utils.py in <genexpr>(.0)
92 return Variable(h.data)
93 else:
---> 94 return tuple(repackage_hidden(v) for v in h)
95
96 ###################### Summary
~/SageMaker/MBA/Instacart/src/utils.py in repackage_hidden(h)
92 return Variable(h.data)
93 else:
---> 94 return tuple(repackage_hidden(v) for v in h)
95
96 ###################### Summary
~/SageMaker/MBA/Instacart/src/utils.py in <genexpr>(.0)
92 return Variable(h.data)
93 else:
---> 94 return tuple(repackage_hidden(v) for v in h)
95
96 ###################### Summary
~/SageMaker/MBA/Instacart/src/utils.py in repackage_hidden(h)
92 return Variable(h.data)
93 else:
---> 94 return tuple(repackage_hidden(v) for v in h)
95
96 ###################### Summary
~/SageMaker/MBA/Instacart/src/utils.py in <genexpr>(.0)
92 return Variable(h.data)
93 else:
---> 94 return tuple(repackage_hidden(v) for v in h)
95
96 ###################### Summary
~/SageMaker/MBA/Instacart/src/utils.py in repackage_hidden(h)
92 return Variable(h.data)
93 else:
---> 94 return tuple(repackage_hidden(v) for v in h)
95
96 ###################### Summary
~/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/torch/tensor.py in __iter__(self)
382 # map will interleave them.)
383 if self.dim() == 0:
--> 384 raise TypeError('iteration over a 0-d tensor')
385 if torch._C._get_tracing_state():
386 warnings.warn('Iterating over a tensor might cause the trace to be incorrect. '
TypeError: iteration over a 0-d tensor
The text was updated successfully, but these errors were encountered:
Running the train file results in this error:
The text was updated successfully, but these errors were encountered: