microsoft / singleshotpose

This research project implements a real-time object detection and pose estimation method as described in the paper, Tekin et al. "Real-Time Seamless Single Shot 6D Object Pose Prediction", CVPR 2018. (https://arxiv.org/abs/1711.08848).
MIT License
725 stars 214 forks source link

Python 3 and Pytorch 0.4 compatible version,Type error #94

Closed G-YY closed 5 years ago

G-YY commented 5 years ago

I test the version that is Python 3 and Pytorch 0.4 compatible,but have met the following error: 2019-06-08 16:03:42 Testing ape... Traceback (most recent call last): File "valid_multi.py", line 170, in valid(datacfg, cfgfile, weightfile, conf_th) File "valid_multi.py", line 78, in valid for batch_idx, (data, target) in enumerate(test_loader): File "/home/lab/.local/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 336, in next return self._process_next_batch(batch) File "/home/lab/.local/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 357, in _process_next_batch raise batch.exc_type(batch.exc_msg) TypeError: Traceback (most recent call last): File "/home/lab/.local/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 106, in _worker_loop samples = collate_fn([dataset[i] for i in batch_indices]) File "/home/lab/.local/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 106, in samples = collate_fn([dataset[i] for i in batch_indices]) File "/home/lab/singleshot6Dpose/multi_obj_pose_estimation/dataset_multi.py", line 79, in getitem tmp = torch.from_numpy(read_truths_args(labpath, 8.0/ow)) TypeError: read_truths_args() takes 1 positional argument but 2 were given

My env:torch 0.4,python 3.5 ,GPU 2080ti ,cuda 10

shiqingshina commented 5 years ago

Hi, i wanna know how to solve this problem. i met it too. Thanks for your help!

ghost commented 5 years ago

Hi!

I have the same problem, could you share the solution with us please. Thanks

shiqingshina commented 5 years ago

i solved this. feel free to make some change on the code. here is my change: in dataset_multi.py line 79

tmp = torch.from_numpy(read_truths_args(labpath, 8.0/ow))

            tmp = torch.from_numpy(read_truths_args(labpath))

AND in utils.py, you could find the function read_truths_args() takes only the labpath parameter

ghost commented 5 years ago

Thank you!

I will try it today.