-
Notifications
You must be signed in to change notification settings - Fork 476
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
AttributeError: 'NoneType' object has no attribute 'shape' #21
Comments
@lufei92 I met the same problem. Have you solved this problem? |
Can you try the suggestion here? |
@heilaw
The shape of the image can be seen. But when I try to run the code the problem shows again. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @lufei92 |
sorry, i changed my batchsize and chunck size, but the prooblem is still appear. and i print image path, the images are read, so idon't know why occurs this problem |
Can you add |
@heilaw the follow is my result after adding print(image.shape) under line 89 in `sample/coco.py': shuffling indices... |
The result is that. /home/min/anaconda3/envs/CornerNet/bin/python /home/min/freeman/CornerNet/train.py CornerNet (325, 500, 3) |
Thanks for your help. The problem has been solved. |
@scL18 which place you have changed? |
@heilaw my images are placed where you required as follow: |
From the output you provided, some images do not exist. Can you check if |
@lufei92 I changed the annotations of the images. The annotations should be [2014 Train/Val annotations [241MB]. (http://images.cocodataset.org/annotations/annotations_trainval2014.zip) |
It seems that the code cannot read your images. You should check if the image paths are correct. (line 74 in |
i meet the bug: emm.... what's the meaning of Segmentation fault ??? |
loading all datasets... hi,excuse me,could you please tell me how to solve it? |
I know your problem, it's your GPU insufficient operating space,you can change the chunk_sizes and batch_size in /config/CornerNet.json |
Hi, have you solved this error? Thank you! |
hello, i train your code according to you provide steps, but occurs follow problem:
loading all datasets...
using 4 threads
loading from cache file: /home/gosuncn/detection/CornerNet-master/cache/coco_trainval2014.pkl
loading annotations into memory...
Done (t=14.30s)
creating index...
index created!
loading from cache file: /home/gosuncn/detection/CornerNet-master/cache/coco_trainval2014.pkl
loading annotations into memory...
Done (t=13.85s)
creating index...
index created!
loading from cache file: /home/gosuncn/detection/CornerNet-master/cache/coco_trainval2014.pkl
loading annotations into memory...
Done (t=13.05s)
creating index...
index created!
loading from cache file: /home/gosuncn/detection/CornerNet-master/cache/coco_trainval2014.pkl
loading annotations into memory...
Done (t=18.46s)
creating index...
index created!
loading from cache file: /home/gosuncn/detection/CornerNet-master/cache/coco_minival2014.pkl
loading annotations into memory...
Done (t=0.41s)
creating index...
index created!
system config...
{'batch_size': 49,
'cache_dir': '/home/gosuncn/detection/CornerNet-master/cache',
'chunk_sizes': [4, 5, 5, 5, 5, 5, 5, 5, 5, 5],
'config_dir': '/home/gosuncn/detection/CornerNet-master/config',
'data_dir': '/home/gosuncn/detection/CornerNet-master/data/',
'data_rng': <mtrand.RandomState object at 0x7f2c28ed32d0>,
'dataset': 'MSCOCO',
'decay_rate': 10,
'display': 5,
'learning_rate': 0.00025,
'max_iter': 500000,
'nnet_rng': <mtrand.RandomState object at 0x7f2c28ed3360>,
'opt_algo': 'adam',
'prefetch_size': 5,
'pretrain': None,
'result_dir': '/home/gosuncn/detection/CornerNet-master/data/coco/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}
len of db: 118287
start prefetching data...
start prefetching data...
shuffling indices...
shuffling indices...
start prefetching data...
Traceback (most recent call last):
File "train.py", line 42, in prefetch_data
data, ind = sample_data(db, ind, data_aug=data_aug)
File "/home/gosuncn/detection/CornerNet-master/sample/coco.py", line 182, in sample_data
return globals()[system_configs.sampling_function](db, k_ind, data_aug, debug)
File "/home/gosuncn/detection/CornerNet-master/sample/coco.py", line 96, in kp_detection
image, detections = random_crop(image, detections, rand_scales, input_size, border=border)
File "/home/gosuncn/detection/CornerNet-master/sample/utils.py", line 57, in random_crop
image_height, image_width = image.shape[0:2]
AttributeError: 'NoneType' object has no attribute 'shape'
Process Process-2:
Traceback (most recent call last):
File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "train.py", line 46, in prefetch_data
raise e
File "train.py", line 42, in prefetch_data
data, ind = sample_data(db, ind, data_aug=data_aug)
File "/home/gosuncn/detection/CornerNet-master/sample/coco.py", line 182, in sample_data
return globals()[system_configs.sampling_function](db, k_ind, data_aug, debug)
File "/home/gosuncn/detection/CornerNet-master/sample/coco.py", line 96, in kp_detection
image, detections = random_crop(image, detections, rand_scales, input_size, border=border)
File "/home/gosuncn/detection/CornerNet-master/sample/utils.py", line 57, in random_crop
image_height, image_width = image.shape[0:2]
AttributeError: 'NoneType' object has no attribute 'shape'
shuffling indices...
start prefetching data...
Traceback (most recent call last):
File "train.py", line 42, in prefetch_data
data, ind = sample_data(db, ind, data_aug=data_aug)
File "/home/gosuncn/detection/CornerNet-master/sample/coco.py", line 182, in sample_data
return globals()[system_configs.sampling_function](db, k_ind, data_aug, debug)
File "/home/gosuncn/detection/CornerNet-master/sample/coco.py", line 96, in kp_detection
image, detections = random_crop(image, detections, rand_scales, input_size, border=border)
File "/home/gosuncn/detection/CornerNet-master/sample/utils.py", line 57, in random_crop
image_height, image_width = image.shape[0:2]
AttributeError: 'NoneType' object has no attribute 'shape'
Process Process-1:
Traceback (most recent call last):
File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "train.py", line 46, in prefetch_data
raise e
File "train.py", line 42, in prefetch_data
data, ind = sample_data(db, ind, data_aug=data_aug)
File "/home/gosuncn/detection/CornerNet-master/sample/coco.py", line 182, in sample_data
return globals()[system_configs.sampling_function](db, k_ind, data_aug, debug)
File "/home/gosuncn/detection/CornerNet-master/sample/coco.py", line 96, in kp_detection
image, detections = random_crop(image, detections, rand_scales, input_size, border=border)
File "/home/gosuncn/detection/CornerNet-master/sample/utils.py", line 57, in random_crop
image_height, image_width = image.shape[0:2]
AttributeError: 'NoneType' object has no attribute 'shape'
shuffling indices...
Traceback (most recent call last):
File "train.py", line 42, in prefetch_data
data, ind = sample_data(db, ind, data_aug=data_aug)
File "/home/gosuncn/detection/CornerNet-master/sample/coco.py", line 182, in sample_data
return globals()[system_configs.sampling_function](db, k_ind, data_aug, debug)
File "/home/gosuncn/detection/CornerNet-master/sample/coco.py", line 96, in kp_detection
image, detections = random_crop(image, detections, rand_scales, input_size, border=border)
File "/home/gosuncn/detection/CornerNet-master/sample/utils.py", line 57, in random_crop
image_height, image_width = image.shape[0:2]
AttributeError: 'NoneType' object has no attribute 'shape'
Process Process-4:
Traceback (most recent call last):
File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "train.py", line 46, in prefetch_data
raise e
File "train.py", line 42, in prefetch_data
data, ind = sample_data(db, ind, data_aug=data_aug)
File "/home/gosuncn/detection/CornerNet-master/sample/coco.py", line 182, in sample_data
return globals()[system_configs.sampling_function](db, k_ind, data_aug, debug)
File "/home/gosuncn/detection/CornerNet-master/sample/coco.py", line 96, in kp_detection
image, detections = random_crop(image, detections, rand_scales, input_size, border=border)
File "/home/gosuncn/detection/CornerNet-master/sample/utils.py", line 57, in random_crop
image_height, image_width = image.shape[0:2]
AttributeError: 'NoneType' object has no attribute 'shape'
building model...
module_file: models.CornerNet
start prefetching data...
Traceback (most recent call last):
File "train.py", line 42, in prefetch_data
data, ind = sample_data(db, ind, data_aug=data_aug)
File "/home/gosuncn/detection/CornerNet-master/sample/coco.py", line 182, in sample_data
return globals()[system_configs.sampling_function](db, k_ind, data_aug, debug)
File "/home/gosuncn/detection/CornerNet-master/sample/coco.py", line 96, in kp_detection
image, detections = random_crop(image, detections, rand_scales, input_size, border=border)
File "/home/gosuncn/detection/CornerNet-master/sample/utils.py", line 57, in random_crop
image_height, image_width = image.shape[0:2]
AttributeError: 'NoneType' object has no attribute 'shape'
Process Process-3:
Traceback (most recent call last):
File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "train.py", line 46, in prefetch_data
raise e
File "train.py", line 42, in prefetch_data
data, ind = sample_data(db, ind, data_aug=data_aug)
File "/home/gosuncn/detection/CornerNet-master/sample/coco.py", line 182, in sample_data
return globals()[system_configs.sampling_function](db, k_ind, data_aug, debug)
File "/home/gosuncn/detection/CornerNet-master/sample/coco.py", line 96, in kp_detection
image, detections = random_crop(image, detections, rand_scales, input_size, border=border)
File "/home/gosuncn/detection/CornerNet-master/sample/utils.py", line 57, in random_crop
image_height, image_width = image.shape[0:2]
AttributeError: 'NoneType' object has no attribute 'shape'
shuffling indices...
total parameters: 201035212
setting learning rate to: 0.00025
training start...
0%| | 0/500000 [00:00<?, ?it/s]
the path i also changed as follow:
self._configs["data_dir"] = "/home/gosuncn/detection/CornerNet-master/data"
self._configs["cache_dir"] = "/home/detection/CornerNet-master/cache"
self._configs["config_dir"] = "/home/detection/CornerNet-master/config"
self._configs["result_dir"] = "/home/detection/CornerNet-master/data/coco/results"
so i don't know why it cannot read images according to my path
The text was updated successfully, but these errors were encountered: