hyf015 / egocentric-gaze-prediction

Code for the paper "Predicting Gaze in Egocentric Video by Learning Task-dependent Attention Transition"
62 stars 18 forks source link

TypeError: expected np.ndarray (got NoneType) #24

Closed BIT-LiuQingXiao closed 3 years ago

BIT-LiuQingXiao commented 3 years ago

Thanks for your shared code! When I followed the guidelines, I met the problem as below: Traceback (most recent call last): File "gaze_full.py", line 99, in sp.train() File "/home/lqx/LabCode/Gaze/SP.py", line 199, in train loss1 = self.trainSP() File "/home/lqx/LabCode/Gaze/SP.py", line 125, in trainSP for i, sample in tqdm(enumerate(self.STTrainLoader)): File "/usr/local/lib/python3.5/dist-packages/tqdm/std.py", line 1178, in iter for obj in iterable: File "/home/lqx/.local/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 286, in next return self._process_next_batch(batch) File "/home/lqx/.local/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 307, in _process_next_batch raise batch.exc_type(batch.exc_msg) TypeError: Traceback (most recent call last): File "/home/lqx/.local/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 57, in _worker_loop samples = collate_fn([dataset[i] for i in batch_indices]) File "/home/lqx/.local/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 57, in samples = collate_fn([dataset[i] for i in batch_indices]) File "/home/lqx/LabCode/Gaze/data/STdatas.py", line 68, in getitem flowarr.append(torch.from_numpy(currflowx)) TypeError: expected np.ndarray (got list). I used python 3.5, Cuda 8.0, torch 0.4, opencv 2.4.13, numpy 1.14. It seems like caused by wrong numpy

hyf015 commented 3 years ago

Thank you for your interest in the code! I've never met such problems and neither did other reproducers. Can you check whether the optical flow files are correct? Maybe it is a data preprocessing problem.

BIT-LiuQingXiao commented 3 years ago

Thanks a lot, your advice works