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
I still have the error: AttributeError: 'NoneType' object has no attribute 'shape' #232
Comments
Both for train and test. |
Check my question @201814476285951 |
I have also encountered this problem. The reason for this problem is that you cannot find the corresponding image under ‘images’ through your train.json and test.json, and make sure that all the images involved in the json file are placed in the images. |
I also have this problem. How did you solve it? |
It means that images are not loaded. You need check paths of images. @1356789-rr |
Starting training... @VRCMF Hello, it was normal at the beginning of the training. Why did this problem occur later? |
@1356789-rr hi, it might be the missing of training images or the incomplete path of training images in .json file. You should check it out. |
Hello, take the liberty of asking, is there any path information in JSON file? My dataset is xml to json. The main information is as follows. |
@1356789-rr hi, you could refer the coco format provided by official web. Also, there might be a situation that a image do not exist in the image path of json file. |
/home/ying/anaconda3/envs/CenterNet/bin/python /home/ying/CenterNet-master/src/main.py
Fix size testing.
training chunk_sizes: [32]
The output will be saved to /home/ying/CenterNet-master/src/lib/../../exp/ctdet/coco_dla
heads {'hm': 80, 'wh': 2, 'reg': 2}
Namespace(K=100, aggr_weight=0.0, agnostic_ex=False, arch='dla_34', aug_ddd=0.5, aug_rot=0, batch_size=32, cat_spec_wh=False, center_thresh=0.1, chunk_sizes=[32], data_dir='/home/ying/CenterNet-master/src/lib/../../data', dataset='coco', debug=0, debug_dir='/home/ying/CenterNet-master/src/lib/../../exp/ctdet/coco_dla/debug', debugger_theme='white', demo='/home/ying/CornerNet-master/data/tool/images/val/00000451.jpg', dense_hp=False, dense_wh=False, dep_weight=1, dim_weight=1, down_ratio=4, eval_oracle_dep=False, eval_oracle_hm=False, eval_oracle_hmhp=False, eval_oracle_hp_offset=False, eval_oracle_kps=False, eval_oracle_offset=False, eval_oracle_wh=False, exp_dir='/home/ying/CenterNet-master/src/lib/../../exp/ctdet', exp_id='coco_dla', fix_res=True, flip=0.5, flip_test=False, gpus=[0], gpus_str='0', head_conv=256, heads={'hm': 80, 'wh': 2, 'reg': 2}, hide_data_time=False, hm_hp=True, hm_hp_weight=1, hm_weight=1, hp_weight=1, input_h=512, input_res=512, input_w=512, keep_res=False, kitti_split='3dop', load_model='/home/ying/CenterNet-master/models/ctdet_coco_dla_2x.pth', lr=0.000125, lr_step=[90, 120], master_batch_size=32, mean=array([[[0.40789655, 0.44719303, 0.47026116]]], dtype=float32), metric='loss', mse_loss=False, nms=False, no_color_aug=False, norm_wh=False, not_cuda_benchmark=False, not_hm_hp=False, not_prefetch_test=False, not_rand_crop=False, not_reg_bbox=False, not_reg_hp_offset=False, not_reg_offset=False, num_classes=80, num_epochs=140, num_iters=-1, num_stacks=1, num_workers=4, off_weight=1, output_h=128, output_res=128, output_w=128, pad=31, peak_thresh=0.2, print_iter=0, rect_mask=False, reg_bbox=True, reg_hp_offset=True, reg_loss='l1', reg_offset=True, resume=False, root_dir='/home/ying/CenterNet-master/src/lib/../..', rot_weight=1, rotate=0, save_all=False, save_dir='/home/ying/CenterNet-master/src/lib/../../exp/ctdet/coco_dla', scale=0.4, scores_thresh=0.1, seed=317, shift=0.1, std=array([[[0.2886383 , 0.27408165, 0.27809834]]], dtype=float32), task='ctdet', test=False, test_scales=[1.0], trainval=False, val_intervals=5, vis_thresh=0.3, wh_weight=0.1)
Creating model...
loaded /home/ying/CenterNet-master/models/ctdet_coco_dla_2x.pth, epoch 230
Setting up data...
==> initializing coco 2017 val data.
loading annotations into memory...
Done (t=0.53s)
creating index...
index created!
Loaded val 5000 samples
==> initializing coco 2017 train data.
loading annotations into memory...
Done (t=13.66s)
creating index...
index created!
Loaded train 118287 samples
Starting training...
Traceback (most recent call last):
File "/home/ying/CenterNet-master/src/main.py", line 102, in
main(opt)
File "/home/ying/CenterNet-master/src/main.py", line 70, in main
log_dict_train, _ = trainer.train(epoch, train_loader)
File "/home/ying/CenterNet-master/src/lib/trains/base_trainer.py", line 119, in train
return self.run_epoch('train', epoch, data_loader)
File "/home/ying/CenterNet-master/src/lib/trains/base_trainer.py", line 61, in run_epoch
for iter_id, batch in enumerate(data_loader):
File "/home/ying/anaconda3/envs/CenterNet/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 336, in next
return self._process_next_batch(batch)
File "/home/ying/anaconda3/envs/CenterNet/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 357, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
AttributeError: Traceback (most recent call last):
File "/home/ying/anaconda3/envs/CenterNet/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 106, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/ying/anaconda3/envs/CenterNet/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 106, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/ying/CenterNet-master/src/lib/datasets/sample/ctdet.py", line 39, in getitem
height, width = img.shape[0], img.shape[1]
AttributeError: 'NoneType' object has no attribute 'shape'
Process finished with exit code 1
Please help me.Thanks a lot.
The text was updated successfully, but these errors were encountered: