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

TypeError: Argument 'angle' can not be treated as a double #3

Open
Kana-alt opened this issue Jun 11, 2021 · 6 comments
Open

TypeError: Argument 'angle' can not be treated as a double #3

Kana-alt opened this issue Jun 11, 2021 · 6 comments

Comments

@Kana-alt
Copy link

Kana-alt commented Jun 11, 2021

I'm sorry for asking so many questions.

I'm trying to get to the "train" stage.

I am trying to "CUDA_VISIBLE_DEVICES=0 python train/train_refinenet.py --arch pose_resnet_refine --checkpoint . /checkpoint/all/syn_refinenet --animal all --solver adam --dataset synthetic_animal_sp_all --dataset_real real_animal_all --train_on_all_ cat" was successfully executed.

Then run "CUDA_VISIBLE_DEVICES=0 python train/train_refinenet_mt.py --arch pose_resnet_refine_mt_multida --checkpoint ./checkpoint/all/syn2real_refinenet_mt --dual_branch --mixup_dual --dataset_real_crop real_animal_crop_all --occlusion_aug --pretrained ./checkpoint/all/syn_refinenet_re/model_best.pth.tar --animal all --dataset_real real_animal_all --dataset synthetic_animal_sp_all --train_on_all_cat --generate_pseudol
", the following error occurred.

Please let me know the solution.

Epoch: 1 | LR: 0.000250 | Trg_weight: 15.000000 | C2rcons_weight: 0.606415

==> real_animal_all
Animal:horse, number of frames:13545, train: 8380, valid: 1772
Total number of frames:13545, train: 8380, valid 1772
load from mean file: ./data/synthetic_animal/all_combineds5r5_texture/mean.pth.tar
Real animal mean: 0.3999, 0.3909, 0.3871
Real animal std: 0.2589, 0.2431, 0.2291
Traceback (most recent call last):
File "train/train_refinenet_mt.py", line 547, in
main(parser.parse_args())
File "train/train_refinenet_mt.py", line 182, in main
score_map, generated_kpts = prediction_check(previous_img, previous_kpts, trg_img[i], model, real_dataset_train, device, num_transform=5)
File "C:\Users\kana\Desktop\Synthetic-Animals2\UDA-Animal-Pose-main\train..\CCSSL\scripts\consistency.py", line 59, in prediction_check
M = cv2.getRotationMatrix2D((32,32),-rot,1)
TypeError: Argument 'angle' can not be treated as a double

@chaneyddtt
Copy link
Owner

Hi @Kana-alt, you are welcome to ask questions. I could not reproduce you error currently. May I know your python version?

@Kana-alt
Copy link
Author

I use
Python 3.6.13

@chaneyddtt
Copy link
Owner

Can you try python 3.7 and opencv-python 4.1.1.26, and see whether the error still occurs?

@Kana-alt
Copy link
Author

Thanks for the reply!

I changed the environment and tried again.
Next time I got this error.

==> creating model 'pose_resnet_refine'
Init Network from model zoo
Total params: 29.48M
init all synthetic animal super augmentation
Animal: horse, training samples: 8000, valid samples: 2000
Traceback (most recent call last):
File "train/train_refinenet.py", line 439, in
main(parser.parse_args())
File "train/train_refinenet.py", line 112, in main
train_dataset = datasets.dict[args.dataset](is_train=True, **vars(args))
File "C:\Users\kana\Desktop\UDA-Animal-Pose-main\train..\pose\datasets\synthetic_animal_sp_all.py", line 248, in synthetic_animal_sp_all
return Synthetic_Animal_SP_All(**kwargs)
File "C:\Users\kana\Desktop\UDA-Animal-Pose-main\train..\pose\datasets\synthetic_animal_sp_all.py", line 90, in init
self.load_animal()
File "C:\Users\kana\Desktop\UDA-Animal-Pose-main\train..\pose\datasets\synthetic_animal_sp_all.py", line 128, in load_animal
self.train_set.append(imgpath[train_idxs[idx]])
IndexError: list index out of range

@chaneyddtt
Copy link
Owner

Do you generate the keypoints_18.json file by yourself? If so, can you check the length of the imgpath by print(len(imgpath)) to check whether you write the data properly?

@Kana-alt
Copy link
Author

I've got it figured out! Thank you.

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