chaneyddtt / UDA-Animal-Pose

MIT License
101 stars 12 forks source link

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

Open Kana-alt opened 3 years ago

Kana-alt commented 3 years ago

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_onall 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 commented 3 years ago

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

Kana-alt commented 3 years ago

I use Python 3.6.13

chaneyddtt commented 3 years ago

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

Kana-alt commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

I've got it figured out! Thank you.