Open visionbike opened 5 years ago
Hi,
Did you try the original examples that are provided? If not please try running train_mobilenet_object_detection.sh Does it work?
Your script refers to files caffe-jdetnet/models/train_jdetnet_model.py, caffe-jdetnet/models/mobilenetv2.py etc. What are these files? Where did you get them from?
Hi, I tried train_mobilenet_object_detection.sh. It is ok when I tried model_name=mobiledetnet-0.5. However, when I tried with mobiledetnetv2-0.5, I got the above error. I detected the error refers to caffe-jdetnet/models/mobilenetv2.py - mobiledetnetv2 method.
Okay. I understand now. I have not spend a much time with mobiledetnetv2, but as I remember, it was working when I defined it.
Most probably the line: https://github.com/tidsp/caffe-jacinto-models/blob/caffe-0.17/scripts/models/mobilenetv2.py#L214 doesn't have the correct name and 'relu5_5/sep' probably needs to be changed to something else.
If you find the correct name quickly, let me know. Otherwise I shall try to investigate it.
In fact I just found out that the names 'relu5_5/sep' and 'relu6/sep' are from mobilenet.py So they don't seem to be correct names for mobilenetv2.
What you need to do is generate the mobilenetv2 prototxt using train_mobilenet_classification.sh The visualize the prototxt in a visualizer such as netscope or netron and find the correct layer names to be used in mobiledetnetv2.
Hi, When I tried with mobiledetnetv2, I got the following problem: solver_param: {'type': 'SGD', 'max_iter': 120000, 'stepvalue': [60000, 90000, 300000], 'base_lr': 0.01, 'lr_policy': 'multistep', 'power': 1.0, 'weight_decay': 0.0001} config_param: {'model_name': 'mobiledetnetv2-0.5', 'config_name': '/home/user/projects/caffe-jdetnet/trained_models/rovit_traffic_dataset/mobiledetnetv2-0.5/2019_01_24/ssd_256x256_ds_PSP_dsFac_32_hdDS8_1/initial', 'gpus': '0', 'threads': 8, 'pretrain_model': '/home/user/projects/caffe-jdetnet/pretrained_models/imagenet_mobilenet-0.5_iter_320000.caffemodel', 'dataset': 'rovit_traffic_dataset', 'train_data': '/media/user/DATA/data/rovit_traffic_dataset/lmdb/rovit_traffic_dataset_trainval_lmdb', 'test_data': '/media/user/DATA/data/rovit_traffic_dataset/lmdb/rovit_traffic_dataset_test_lmdb', 'name_size_file': '/media/user/DATA/data/rovit_traffic_dataset/test_name_size.txt', 'label_map_file': '/media/user/DATA/data/rovit_traffic_dataset/labelmap_rovit_traffic_dataset.prototxt', 'num_test_image': 21375, 'num_classes': 8, 'ssd_size': '256x256', 'use_batchnorm_mbox': 1, 'small_object': 1, 'mean_value': 128, 'use_batchnorm': False, 'use_scale': True, 'lr_mult': 1, 'kernel_mbox_loc_conf': 1, 'chop_num_heads': 0, 'num_intermediate': 512, 'rhead_name_non_linear': 0, 'first_hd_same_op_ch': 1, 'reg_head_at_ds8': 1, 'aspect_ratio_type': 1, 'concat_reg_head': 0, 'base_nw_3_head': 0, 'use_difficult_gt': 1, 'evaluate_difficult_gt': 0, 'ignore_difficult_gt': False, 'fully_conv_at_end': 0, 'force_color': 0, 'shuffle': 1, 'use_image_list': 1, 'log_space_steps': 0, 'min_ratio': 5, 'max_ratio': 85, 'batch_size': 16, 'accum_batch_size': 16, 'test_batch_size': 8, 'feature_stride': 32, 'num_feature': 32, 'ds_type': 'PSP', 'ds_fac': 32, 'min_dim': 256, 'resize_width': 256, 'resize_height': 256, 'crop_width': 256, 'crop_height': 256, 'run_soon': True, 'resume_training': True, 'remove_old_models': False, 'stride_list': None, 'dilation_list': None, 'freeze_layers': [], 'flip': True, 'clip': False, 'share_location': True, 'background_label_id': 0, 'normalization_mode': 1, 'code_type': 2, 'ignore_cross_boundary_bbox': False, 'mining_type': 1, 'neg_pos_ratio': 3.0, 'loc_weight': 1.0} config_param.ds_fac: 32 config_param.stride_list: [2, 2, 2, 2, 2] Traceback (most recent call last): File "/home/user/projects/caffe-jdetnet/train_jdetnet.py", line 221, in
train(config_param, solver_param, caffe_cmd)
File "/home/user/projects/caffe-jdetnet/models/train_jdetnet_model.py", line 768, in train
net, out_layer, out_layer_names = CoreNetwork(config_param, net, out_layer)
File "/home/user/projects/caffe-jdetnet/models/train_jdetnet_model.py", line 338, in CoreNetwork
num_intermediate=config_param['num_intermediate'])
File "/home/user/projects/caffe-jdetnet/models/mobilenetv2.py", line 230, in mobiledetnetv2
num_input = num_channels[from_layer]
KeyError: 'relu5_5/sep'
Is this the problem about model architect? How to solve it?
Thank you.