Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

train error #2

Open
tianjiahao opened this issue Nov 28, 2018 · 1 comment
Open

train error #2

tianjiahao opened this issue Nov 28, 2018 · 1 comment

Comments

@tianjiahao
Copy link

myubuntu@myubuntu-Precision-WorkStation-T5500:~/Music/pytorch-pil$ sh run_train.sh
Human Pose Estimation with Parsing Induced Learner: [Train and Val Phase]
Loading training json file: dataset/lip/jsons/LIP_SP_TRAIN_annotations.json...
Finished loading training json file
Loading evaluation json file: dataset/lip/jsons/LIP_SP_VAL_annotations.json...
Finished loading evaluation json file
Traceback (most recent call last):
File "main.py", line 394, in
main()
File "main.py", line 166, in main
train(train_loader, hpe_with_pil_net, pose_criterion, parsing_criterion, optimizer, epoch)
File "main.py", line 222, in train
for i, (im, pose_target, parsing_target) in enumerate(train_loader):
File "/home/myubuntu/anaconda3/envs/pytorch-PIL/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 201, in next
return self._process_next_batch(batch)
File "/home/myubuntu/anaconda3/envs/pytorch-PIL/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 221, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
TypeError: Traceback (most recent call last):
File "/home/myubuntu/anaconda3/envs/pytorch-PIL/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 40, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/myubuntu/anaconda3/envs/pytorch-PIL/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 40, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/myubuntu/Music/pytorch-pil/utils/data_loader.py", line 136, in getitem
pose_target = target_gen.gen_pose_target(flipped_joints, visibility, self.pose_net_stride, grid_x, grid_y, self.sigma)
File "/home/myubuntu/Music/pytorch-pil/utils/target_generation.py", line 48, in gen_pose_target
gaussian_maps = np.zeros((joint_num + 1, grid_y, grid_x))
TypeError: 'float' object cannot be interpreted as an integer
should I modify it in the source code? how to solve this problem?

@gaoyao123
Copy link

grid_y and grid_x are float numbers,so you must transform them into integer by int().You can use pdb.set_trace() to verify it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants