CornerNet icon indicating copy to clipboard operation
CornerNet copied to clipboard

test problems :AttributeError: 'NoneType' object has no attribute 'shape'

Open fanzhaowei opened this issue 6 years ago • 7 comments

hi @heilaw @ywchao @jiadeng @anewell when I test pictures I got this problem,I have already put the pictures in correct folder,could you please tell me how to solve it?thank you! (CornerNet) b306@cv:~/fanzhaowei/CornerNet-master$ python test.py CornerNet --testiter 500000 --split testing cfg_file: ./config/CornerNet.json loading all datasets... split: testdev loading from cache file: ./cache/coco_testdev2017.pkl loading annotations into memory... Done (t=0.06s) creating index... index created! system config... {'batch_size': 49, 'cache_dir': './cache', 'chunk_sizes': [4, 5, 5, 5, 5, 5, 5, 5, 5, 5], 'config_dir': './config', 'data_dir': '/home/b306/fanzhaowei/CornerNet-master/data', 'data_rng': <mtrand.RandomState object at 0x7f4cbfa899d8>, 'dataset': 'MSCOCO', 'decay_rate': 10, 'display': 5, 'learning_rate': 0.00025, 'max_iter': 500000, 'nnet_rng': <mtrand.RandomState object at 0x7f4cbfa89a20>, 'opt_algo': 'adam', 'prefetch_size': 5, 'pretrain': None, 'result_dir': './results', 'sampling_function': 'kp_detection', 'snapshot': 5000, 'snapshot_name': 'CornerNet', 'stepsize': 450000, 'test_split': 'testdev', 'train_split': 'trainval', 'val_iter': 100, 'val_split': 'minival', 'weight_decay': False, 'weight_decay_rate': 1e-05, 'weight_decay_type': 'l2'} db config... {'ae_threshold': 0.5, 'border': 128, 'categories': 80, 'data_aug': True, 'gaussian_bump': True, 'gaussian_iou': 0.7, 'gaussian_radius': -1, 'input_size': [511, 511], 'lighting': True, 'max_per_image': 100, 'merge_bbox': False, 'nms_algorithm': 'exp_soft_nms', 'nms_kernel': 3, 'nms_threshold': 0.5, 'output_sizes': [[128, 128]], 'rand_color': True, 'rand_crop': True, 'rand_pushes': False, 'rand_samples': False, 'rand_scale_max': 1.4, 'rand_scale_min': 0.6, 'rand_scale_step': 0.1, 'rand_scales': array([0.6, 0.7, 0.8, 0.9, 1. , 1.1, 1.2, 1.3]), 'special_crop': False, 'test_scales': [1], 'top_k': 100, 'weight_exp': 8} loading parameters at iteration: 500000 building neural network... module_file: models.CornerNet total parameters: 201035212 loading parameters... loading model from ./cache/nnet/CornerNet/CornerNet_500000.pkl locating kps: 0%| | 0/40504 [00:00<?, ?it/s] Traceback (most recent call last): File "test.py", line 99, in test(testing_db, args.split, args.testiter, args.debug, args.suffix) File "test.py", line 61, in test testing(db, nnet, result_dir, debug=debug) File "/home/b306/fanzhaowei/CornerNet-master/test/coco.py", line 206, in testing return globals()[system_configs.sampling_function](db, nnet, result_dir, debug=debug) File "/home/b306/fanzhaowei/CornerNet-master/test/coco.py", line 77, in kp_detection height, width = image.shape[0:2] AttributeError: 'NoneType' object has no attribute 'shape'

fanzhaowei avatar Nov 22 '18 08:11 fanzhaowei

I still think this is related to incorrect image path. Can you print image_file (line 74) in test/coco.py and check if the image path exists?

heilaw avatar Nov 22 '18 20:11 heilaw

have you solved it? i have the same question, can you share it?

maggiequan avatar Nov 26 '18 12:11 maggiequan

sorry,the problem still exist.

fanzhaowei avatar Nov 26 '18 12:11 fanzhaowei

I have the same question.

tuofeilunhifi avatar Dec 03 '18 06:12 tuofeilunhifi

I have the same problem.

hahanigehaha233 avatar Mar 20 '19 06:03 hahanigehaha233

I try to mv dir minival2014 to trainval2014, and it works, but I block in another problem.

hahanigehaha233 avatar Mar 20 '19 11:03 hahanigehaha233

#Train error#when I use this Net to train my model, This problem always occurs: AttributeError: 'NoneType' object has no attribute 'shape' I think I have put the picture path right, why is this problem always happening. I look forward to your reply, thank you~~~

superjiajia26 avatar Jul 08 '19 01:07 superjiajia26