Leeiieeo / AG-Pose

CVPR2024: Instance-Adaptive and Geometric-Aware Keypoint Learning for Category-Level 6D Object Pose Estimation
MIT License
53 stars 2 forks source link

在NOCS数据集中,train正常运行,test报错 #14

Closed wh631q closed 3 months ago

wh631q commented 4 months ago

/home/wh/anaconda3/envs/agpose/bin/python /home/wh/Documents/code/AG-Pose-main/test.py --config config/REAL/camera_real.yaml --test_epoch 30 2024-07-03 12:57:26,995 - **** Start Logging **** 2024-07-03 12:57:26,995 - Config (path: config/REAL/camera_real.yaml): {'setting': 'supervised', 'train_dataset': {'dataset_name': 'camera_real', 'dataset_dir': './data', 'num_mini_batch_per_epoch': 4000, 'image_size': 224, 'sample_num': 1024, 'outlier_th': 0.1, 'syn_bs': 15, 'real_bs': 5, 'syn_num_workers': 12, 'real_num_workers': 4, 'shuffle': True, 'drop_last': True, 'pin_memory': True}, 'test_dataset': {'img_size': 224, 'sample_num': 1024, 'dataset_dir': './data', 'dataset_name': 'camera'}, 'pose_net': {'rgb_backbone': 'dino', 'cat_num': 6, 'IAKD': {'kpt_num': 96, 'query_dim': 256, 'AttnLayer': {'block_num': 4, 'd_model': 256, 'dim_ffn': 256, 'num_head': 4}}, 'GAFA': {'block_num': 2, 'K': [16, 32], 'd_model': 256}, 'NOCS_Predictor': {'cat_num': 6, 'bins_num': 64, 'AttnLayer': {'block_num': 2, 'd_model': 256, 'dim_ffn': 256, 'num_head': 4}}, 'Reconstructor': {'pts_per_kpt': 10, 'ndim': 256}}, 'optimizer': {'name': 'Adam', 'lr': 0.01, 'weight_decay': 0}, 'lr_scheduler': {'name': 'CyclicLR', 'mode': 'triangular', 'base_lr': 2e-05, 'max_lr': 0.0005, 'step_size_up': 20000, 'step_size_down': 20000, 'cycle_momentum': False}, 'max_epoch': 30, 'loss': {'cd': 2.0, 'nocs': 2.0, 'recon': 15.0, 'delta': 1.0, 'diversity': 10.0, 'pose': 0.3, 'th': 0.01, 'obj_aware': True}, 'rd_seed': 1, 'per_val': 10, 'per_write': 50, 'exp_name': 'camera_real', 'log_dir': 'log/camera_real', 'ckpt_dir': 'log/camera_real/ckpt', 'gpus': '0', 'test_epoch': 30, 'mask_label': False, 'only_eval': False, 'cat_id': -1} 2024-07-03 12:57:26,995 - using gpu: 0 2024-07-03 12:57:26,995 - => creating model ... Using cache found in /home/wh/.cache/torch/hub/facebookresearch_dinov2_main /home/wh/.cache/torch/hub/facebookresearch_dinov2_main/dinov2/layers/swiglu_ffn.py:51: UserWarning: xFormers is not available (SwiGLU) warnings.warn("xFormers is not available (SwiGLU)") /home/wh/.cache/torch/hub/facebookresearch_dinov2_main/dinov2/layers/attention.py:33: UserWarning: xFormers is not available (Attention) warnings.warn("xFormers is not available (Attention)") /home/wh/.cache/torch/hub/facebookresearch_dinov2_main/dinov2/layers/block.py:40: UserWarning: xFormers is not available (Block) warnings.warn("xFormers is not available (Block)") 2024-07-03 12:57:28,921 - => loading checkpoint from path: log/camera_real/ckpt/epoch_30.pt ... no. of test images: 0

Traceback (most recent call last): File "/home/wh/Documents/code/AG-Pose-main/test.py", line 107, in dataloder = torch.utils.data.DataLoader( File "/home/wh/anaconda3/envs/agpose/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 347, in init sampler = RandomSampler(dataset, generator=generator) # type: ignore[arg-type] File "/home/wh/anaconda3/envs/agpose/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 110, in init raise ValueError("num_samples should be a positive integer " ValueError: num_samples should be a positive integer value, but got num_samples=0

图片

wh631q commented 4 months ago

我猜测,是因为test images:0。没有检测到test图片

807448346 commented 4 months ago

没下segmentation那个文件吧

wh631q commented 3 months ago

需要先按照DPDN的文件格式处理数据集,然后放在agpose中