CasiaFan / SSD_EfficientNet

SSD using TensorFlow object detection API with EfficientNet backbone
63 stars 10 forks source link

I got error #1

Open PythonImageDeveloper opened 5 years ago

PythonImageDeveloper commented 5 years ago

I useed EfficientNet as backnone of ssd, When I run python object_detection/builders/model_builder_test.py for testing the API, I got this error:

Traceback (most recent call last):
  File "object_detection/builders/model_builder_test.py", line 203, in test_create_ssd_models_from_config
    model = model_builder.build(model_proto, is_training=True)
  File "/home/mm/API-TF/models/research/object_detection/builders/model_builder.py", line 125, in build
    return _build_ssd_model(model_config.ssd, is_training, add_summaries)
  File "/home/mm/API-TF/models/research/object_detection/builders/model_builder.py", line 248, in _build_ssd_model
    is_training=is_training)
  File "/home/mm/API-TF/models/research/object_detection/builders/model_builder.py", line 224, in _build_ssd_feature_extractor
    return feature_extractor_class(**kwargs)
TypeError: __init__() got an unexpected keyword argument 'conv_hyperparams_fn'

----------------------------------------------------------------------
Ran 16 tests in 0.021s

FAILED (errors=1, skipped=1)
BowieHsu commented 5 years ago

put this FeatureExtractor into keras CONFIG like mobilenet

PythonImageDeveloper commented 5 years ago

Hi @BowieHsu , Did you doing this work? is't works? If so, Please more explain about this, if possible, thanks I don't understand about this, FeatureExtractor into keras CONFIG like mobilenet

BowieHsu commented 5 years ago
屏幕快照 2019-07-08 上午9 10 19

@PythonImageDeveloper kind of like this.

PythonImageDeveloper commented 5 years ago

Hi @BowieHsu @CasiaFan I now got this error when I run python model_main.py in the models/research_object_detection :

    from object_detection.builders import model_builder
  File "/home/mm/API-TF/models/research/object_detection/builders/model_builder.py", line 56, in <module>
    from .efficientnet_feature_extractor import SSDEfficientNetFeatureExtractor, SSDEfficientNetFPNFeatureExtractor
ImportError: No module named 'object_detection.builders.efficientnet_feature_extractor'
CasiaFan commented 5 years ago

@PythonImageDeveloper Sorry for forgetting to add location for efficientnet files. I've updated it in README. These two file should better to put under same directory. In your case, it seems that you put efficient_feature_extractor under builders but efficientnet in other place.

PythonImageDeveloper commented 5 years ago

hi @BowieHsu @CasiaFan I solved this problem, but I have some question: How do I create config file for ssd_effcientnet? Can I modify the ssd_mobilnetv2 confilg file for ssd_efficientnet? If so,Do I must change the type of feature extractor from ssd_mobilenetv2 to ssd_efficientnet, right? But I don't know what put in the section of fine_tune_checkpoint path for this new network?

CasiaFan commented 5 years ago

@PythonImageDeveloper See this issue for sample config. If you'd like to use finetune_checkpoint, you could train EfficientNet on VOC dataset and use its checkpoint to finetune. But in case, since the pretrained checkpoint is not provided, just comment the line fine_tune_checkpoint

PythonImageDeveloper commented 5 years ago

Hi @CasiaFan I have my own dataset that is one class and have 10k images and I also have VOC and COCO datasets, In your opinion, what's options you select for training: 1- Train only 10k my own images 2- Frist train on COCO/VOC dataset and then transfer-learning over 10k my own dataset? Ok this option is good, but If I have one GPU 1080 ti, then can I train with one GPU for training over COCO dataset?

CasiaFan commented 5 years ago

@PythonImageDeveloper In any case, training for enough epochs is the best way. For option 1, add more augmentation methods like mixing up and random erasing, whereas overfitting is somehow inevitable; for the 2nd option, using small batch inputs and group normalization should improve, but a long time is required. So if you are in hurry, use the first method.

CasiaFan commented 5 years ago

@PythonImageDeveloper In any case, training for enough epochs is the best way. For option 1, add more augmentation methods like mixing up and random erasing, whereas overfitting is somehow inevitable; for the 2nd option, using small batch inputs and group normalization should improve, but a long time is required. So if you are in hurry, use the first method.