unable to execute script_BCTT.sh
Closed this issue · 5 comments
Dear BCTT team,
thanks for your work on BCTT. I am currently trying to run script_BCTT.sh but I am getting the following error:
Traceback (most recent call last):
File "code_fang\LDS_tucker.py", line 95, in
model.msg_update_U()
File "code_fang\model_LDS_tucker_full_efficient.py", line 201, in msg_update_U
E_z_del, E_z_del_2 = self.moment_kronecker_tucker(other_modes,self.ind_tr[eid],order='second')
File "\code_fang\model_LDS_tucker_full_efficient.py", line 146, in moment_kronecker_tucker
E_z_2 = self.post_U_v[last_mode][ind[:,last_mode]] + torch.bmm(E_z,E_z.transpose(dim0=1,dim1=2)) # NR_u*R_U
RuntimeError: batch1 must be a 3D tensor
I am rather new to the topic and your paper and was wondering whether you could give me a hint at what is necessary to adapt here?
Thanks in advance!
Thanks for following our work and pointing out the bug!
That bug is caused by the corner case when len(uid)=1, meaning there is only one associated entry of the given mode. The new version of NumPy and Torch seems to have different mechanisms to handle the reshaping of such corner cases, compared with the old version we used two years ago.
We have fixed it by adding shape-check code to handle the corner case at
The latest code should work well to run script_BCTT.sh.
Please let us know if there were further questions.
Sure! I have added the environment.yaml in the repo. Some of the packages are redundant, which are used for other projects. My suggestion is to check the version of the main packages, like numpy, torch, and tensorly.
:)